Low Variables "multiple" parameter issues in "parse" tag
Per the tag docs, I'm trying to loop through a Select variable that has labels via the parse tag. This is for an MSM site.
Here's my setup:
====== TAG =========
{exp:low_variables:parse var="{site_short_name}:credit_cards" multiple="yes"}
{if count == 1}UL id="payment"{/if}
LI
img
src="/img/{credit_cards}.png"
alt="{label}"
/LI
{if count == total_results}/UL{/if}
{/exp:low_variables:parse}
===== LV SETTINGS ======
name: credit_cards
type: Select
options:
visa : Visa
mastercard : Mastercard
amex : American Express
allow for multiple" checked
pipe line
interface: drag and drop
==========================
{credit_cards} outputs the piped values (like a single parse would), label and count print {label} and nothing, respectively.
The 'options' tag works fine, I'm using it as a workaround at the moment.
Please advise. Thanks!
(Edited to format HTML.)
Replies
Low 11 Sep 2011 21:08
Hi! Can you turn on template debugging and look up the parts where it tries to parse the LV tag? And I take it all three variable options are selected?
trif3cta 12 Sep 2011 14:30
Hey there!
All three are selected, yes. It appears to be an issue with including multiple LVs in the same embed.
If I place the 'multiple="yes"' call first, it works. If I place it after a 'single' tag, the parser shows 'no closing tag' and outputs it as if it were single. (It doesn't show the single variable output at all.)
I'm using LV all over and will need it available before and after the 'credit_cards' var.
Thanks for the help sir!
============================================
BROKEN
============================================
{exp:low_variables:parse var="{site_short_name}:copyright_co_name"}
{exp:low_variables:parse
var="{site_short_name}:credit_cards"
multiple="yes"
}
{count}/{credit_cards}/{label}
{/exp:low_variables:parse}
============================================
WORKING
============================================
{exp:low_variables:parse
var="{site_short_name}:credit_cards"
multiple="yes"
}
{count}/{credit_cards}/{label}
{/exp:low_variables:parse}
{exp:low_variables:parse var="{site_short_name}:copyright_co_name"}
Low 12 Sep 2011 14:49
Ah, I see. EE's template parser cannot determine which closing tag belongs to which opening tag. I might change the syntax for a single tag in a future version. For now, you can explicitly close the tag like this:
trif3cta 12 Sep 2011 14:57
That makes sense. I actually have ~10 LVs in this template, should I manually close all of them to get around this?
Low 12 Sep 2011 15:01
For now, that would be the appropriate workaround, yes. In the next version, I'll add aliases like {exp:low_variables:single} and {exp:low_variables:pair}{/exp:low_variables:pair} so you don't need two versions of the same tag.
trif3cta 12 Sep 2011 15:20
Sounds good, we'll look forward to the aliases.
Thanks for the quick and thorough support!