Welcome, Guest
Username: Password: Remember me

TOPIC: if statements and answers/tokens

if statements and answers/tokens 11 months 5 days ago #96052

Is it possible to display a token attribute or previous question from within an if statement?

My syntax is something along the lines of
{if(contact == 'Y', 'Text {municipality} text', 'text')}

I can't make double if statements for both pieces of text, since one option includes the answer, and the other doesnt, so I need some way to include the answer itself into the if statement. The above syntax simply displays {municipality} in plain text (as I rather expected).

I've also tried to 'break out' of the EM by closing and reopening the brackets like below, but the EM stops looking for brackets once it's in the if statement, and simply displays the brackets (which kindof makes sense).
{if(contact == 'Y', 'Text} {municipality} {text', 'text')}

This text is supposed to show up in a group description, so avoiding the whole issue by simply creating a group for each case is something I'ld rather avoid.

Is this possible? Am I missing something obvious?

FYI: We're using Version 1.92+ Build 120319 which I know is slightly(?) outdated.
The administrator has disabled public write access.

if statements and answers/tokens 11 months 5 days ago #96053

After having some coffee and a cookie, I realised what I was doing trying to break out of the EM was rediculous, and put my limited javascript/php experience to work.
{if(contact == 'Y', 'Text ' + municipality + ' text', 'text')}

Does exactly what I want it to.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.266 seconds
Donation Image