Group Group Group Group Group Group Group Group Group

Can't use more than 2 if conditions with leaf template

I’m having trouble nesting more than 2 #if conditions. Here is my code:

<li class="nav-item">
    <a class="nav-link #if(title == "Hairs On Hide" || title == "Car Dashboard" || title == "Car Floor Mat"){active}" href="/products">
        Products
    </a>
</li>

This is part of my Nav and i’m using #if to check which li item need to be active to display proper css styling. The #if tag works fine with 2 conditions, but if I have more than 2 it doesnt work. Is there any solution to this?

That sounds like a bug, can you file an issue on the Leaf GitHub page?

As a workaround, you might have to add multiple if statements for now

1 Like

Ok I just did thank you!