Using Select Entries in Template
I'm using the Select Entries variable type to power the sub-menu of each section on our website, but I haven't found a way to get the template to work. This is what I have now:
<ul class="nav nav-list">
<li class="nav-header">About Section</li>
{exp:channel:entries channel="ffest_pages" entry_id="{lv_menu_about}"}
<li class="active"><a href="{permalink=about}">{title}</a></li>
{/exp:channel:entries}
</ul>
What am I missing? Thanks.
Replies
Low 27 Jun 2012 23:04
You're using the var as input for a tag, so make sure Early Parsing is enabled.
Also make sure the separator is the Pipe character.
Lastly, if you want the entries in the selected order, use the parameter fixed_order="" instead of entry_id="".
Low 27 Jun 2012 23:08
And dynamic="no" might help, too.
Tinch 27 Jun 2012 23:12
Ok, it's outputting entries now, but it's outputting every entry in that channel rather then the ones that are selected. Here's how I've got it:
Early Parsing is enabled and the seperator is set to the Pipe character.
Low 27 Jun 2012 23:20
If you turn on template debugging, you should be able to see the channel:entries tag with all its parameters filled out. What does that tell you?
Tinch 27 Jun 2012 23:35
Actually another way that I was doing this was using the Tables variable type, that worked really well. I could just type in a Menu Item Title and then a Menu Item URL for each Menu Item. But I was trying to find a way to match the {cell_2} to the current URL so I could set an active class on the menu. Any thoughts on that direction?
Tinch 27 Jun 2012 23:38
For example:
Low 28 Jun 2012 06:45
The Select Entries way should work, too. But the Table type will be slightly more efficient. I'd probably just use a value you can use in a {path=""} variable, like this: