Options tag par doesn't work - help please
I am unable to get any output using the options tag pair. I've gone back to just using the sample code on your website (below), and swapping in my variable name. That variable is a select entries variable. I get no output with early parsing on or off - or with the tag pair inside or outside of channel entry tag pairs.
Further, if I forego the options tab pair and just spit out the variables value, I do get the correct entry IDs seperated by pipes.
I am at a loss as to why the code below doesn't work. Can someone help?
BTW, I'm on EE 2.1.3.
Thanks,
Mike
{exp:low_variables:options var="my_multi_var"}
{if count == 1}<ul>{/if}
<li{if active == "y"} class="active"{/if}>{label}</li>
{if count == total_results}</ul>{/if}
{/exp:low_variables:options}
Replies
coalescent.mike 18 Feb 2011 01:08
Odd - the code block doesn't seem to be rendering correctly in the first post - but fyi I'm just using your sample code from your website.
Low 18 Feb 2011 08:47
Hey Mike,
The low_variables:options tag pair is meant for vars that have an 'Options' setting, like the Checkbox Group, Radio Group or Select types. If you want to display the entries that you selected in the Select Entries variable, you're better off putting the var in a channel:entries tag.
Make sure the variable has early parsing enabled, then use code similar to this:
{exp:channel:entries channel="my_channel" entry_id="{my_variable}"}
your entries here
{/exp:channel:entries}
coalescent.mike 21 Feb 2011 20:06
I think you misunderstand me Low. I am not trying to get to the channel entry data - I'm just trying to output data as per your own example at the bottom of this page using the exp:low_variables:options tag pair:
http://loweblog.com/software/low-vari...
However, I am not getting any output. Should I be gettig output for a select variable? If I do not use the tag pair as per your example and just use the single variable tag, I do get the correct selected entry IDs, seperated by a pipe.
Low 21 Feb 2011 20:24
Like the docs say about the exp:low_variables:options tag:
"Use this in combination with the Checkbox Group, Radio Group and Select variable types."
So it won't work with the Select Entries variable type, since that type doesn't have an Options setting. If you want to loop through the values of a Select Entries tag, you'd have to use the exp:low_variables:parse tags. Something like:
{exp:low_variables:parse var="my_var" multiple="yes"}
Entry id: {value}
{/exp:low_variables:parse}
coalescent.mike 21 Feb 2011 21:22
Gotchya - thanks!