Skip to content

Instantly share code, notes, and snippets.

@markterpstra
Created July 24, 2012 20:52
Show Gist options
  • Save markterpstra/3172596 to your computer and use it in GitHub Desktop.
Save markterpstra/3172596 to your computer and use it in GitHub Desktop.
Low Variables Magic - Nesting, Preparsing, Var Types, etc
First I'm using the Low Variables Single tag to pull in a Textarea var type for the country-specific header,
using the preparse: paramter to pass the {lang} and {segment_1} vars...
<div id="header">
{exp:low_variables:single var="lv_header_{lang}" preparse:lang="{lang}" preparse:segment_1="{segment_1}"}
</div>
Then inside the above {lv_header_{lang}} var, I have the country-specific logo, contact info, nav menu, etc.
For the nav menu, I'm using a Low Variables Pair tag to output a nested Playa var type...
<ul>
{exp:low_variables:pair var="lv_main_menu_{lang}"}
<li>
<a href="#"><h3>{cf_page_heading_{lang}}</h3></a>
<ul>
{exp:playa:children field="cf_page_subpage_listing_{lang}"}
<li><a href="/{lang}/{segment_1}/{url_title}">{cf_page_heading_{lang}}</a></li>
{/exp:playa:children}
</ul>
</li>
{/exp:low_variables:pair}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment