Template tag question
-
I have a set of conditional statements in a template. In this example, there is a Pod field called Agent, and it is populated by a dropdown that contains single individual names in the format “John Smith” (no quote marks), and a couple of choices that are combinations of two names, such as “John Smith and Bob Black”.
My [if] statements work fine when any single name is selected from the dropdown. But when a dropdown choice contains two names in the format “John Jones and Bob Black”, the [if] statement fails to work. Here’s an example:
[if agent=”John Smith”]
<p class=”j_button”>Email John</p>
<p>Call John: 555-555-5555</p>
[/if]
[if agent=”Jane Jones”]
<p class=”j_button”>Email Jane</p>
<p>Call Jane: 555-555-5555</p>
[/if]
[if agent=”Bob Black”]
<p class=”j_button”>Email Bob</p>
<p>Call Bob: 585-259-9139</p>
[/if]
[if agent=”John Smith and Bob Black”]
<p class=”j_button”>Email Bob</p>
<p>Call Bob: 555-555-5555</p>
[/if]A look at the Pod item itself shows that the Agent: field says (no quotes) “John Smith and Bob Black”
Yet the conditional stuff on the 4th [if] conditional doesn’t show, presumably because that compound Agent: field is not seen as a plain string by the template.
The first three [if] conditionals work fine.What am I getting wrong?
The page I need help with: [log in to see the link]
- The topic ‘Template tag question’ is closed to new replies.