using low variables for navigation
so, i got rid of embeds in favor of low variables. i'm using this in all my templat code now:
{exp:low_variables:parse var="my_location:XXX"}
{lv_site_header}
{lv_nav }
{/exp:low_variables:parse}
where XXX is either home, services, contact_us, etc.,
So, I want to show the active state in my nav, based on the page the user is on.
in my lv_nav code I have:
<li {if var=='my_location:home'}class="active"{/if}> <a href="{path=site/index}">Home</a></li>
But no cigar...
Can u help.
Thanks!!
Replies
Low 4 Mar 2014 07:43
I think you're using the Parse tag in the wrong way. I presume the lv_site_header and lv_nav vars are Textarea variables with Early Parsing enabled.
You're looking for the preparse: parameter in the Textarea variable type, which is similar to embed variables. So try something like this:
With the following code in lv_nav:
Note that if you're using the Tag syntax for the lv_nav variable, you can disable early parsing, as that's irrelevant for the Tag syntax.
therooster 4 Mar 2014 21:58
Thanks Low!!