Forum
Use a variable in a conditional tag
Is it possible to use a variable in a conditional tag? It doesn't seem to work for me but maybe it does?
<perch:if id="product" value="eq" match="<perch:content id="productlink" />">
Is it possible to use a variable in a conditional tag? It doesn't seem to work for me but maybe it does?
<perch:if id="product" value="eq" match="<perch:content id="productlink" />">
You have
match
andvalue
the wrong way around, so you'll need to swap those. To use a variable, wrap it in{braces}
like this:That was just a mistake while giving an example of the code. But I couldn't find an example in the docs with the variable wrapped in braces to use in a conditional tag.
But works great! Thanks!