Simple navigation with Low Variables
Hi,
I'm a Low-newbie and want to have a simple navigation done with Low Variables. Because it's a better way for managing navigation for clients I think.
Everything is working fine, but I don't know how to achieve a current class. I just want to highlight the current active nav-element.
Any ideas?
Replies
Low 15 Mar 2012 08:33
Hi Thomas,
In your conditional, you need to know what you're testing against. Your example says {if active == "y"}, which implies {active} to be a variable that could have the value "y". But in the low_variables:parse tag, no {active} variable is available.
This means you have to test against something else. For example, you could check the {value} var against {segment_1}, so:
...or something like that.
thomassausen 15 Mar 2012 08:48
I tried it that way and nothing changed.
The class was'nt rendered.
The same code hardcoded without LV is working fine.
Low 15 Mar 2012 08:49
Okay, then what exactly is {value} outputting for each of the items?
thomassausen 15 Mar 2012 08:53
Variable Name: tsdv1_site_menu
Variable Type: Select
Options: / : Home
portfolio : Portfolio
contact : Contact
Allow for multiple items to be selected: checked.
Low 15 Mar 2012 09:03
Is the conditional working for the portfolio and contact pages?
thomassausen 15 Mar 2012 09:04
No.
Low 15 Mar 2012 09:06
Then I cannot reproduce. For me, the conditional is working fine with the code example above.
Can you give me super admin access to your installation, so I can take a look myself? You can send the login credentials to hi at gotolow dot com.
Low 15 Mar 2012 10:06
Hi Thomas,
This is what you had in your template:
In this case, the conditional will look for the literal string "value" instead of the variable {value}. Changing it to...
...without the quotes works as expected. I've made another change to the conditional to account for the first item, where the value is '/':
...so it works for the homepage, too.
thomassausen 15 Mar 2012 10:21
My fault. Thanks a lot. Great.