The magic IF tag and checkboxes

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
User avatar
perarneflo
Bruji Friend
Bruji Friend
Posts: 18
Joined: Mon Aug 29, 2011 12:55 pm
Location: Oslo, Norway

The magic IF tag and checkboxes

Post by perarneflo »

In the Template Tags overview it says:

[key:signed] - Has a value of "yes" or "no". If tag can be used to display a badge.
(I guess this also is the same for key:customCheckbox1 and 2)

How do I write the HTML to do this?

I can only make it to show "Yes" or not show anything if I use the <!--IFsigned [key:signed] ENDsigned--> when the box is checked.
Jonas
Addicted to Bruji
Addicted to Bruji
Posts: 28
Joined: Fri Jan 04, 2008 11:58 am
Location: Sweden

Re: The magic IF tag and checkboxes

Post by Jonas »

Try using just

Code: Select all

[key:signed]
instead of

Code: Select all

<!--IFsigned [key:signed] ENDsigned-->
in the html.

If you use the IF-tags it only shows when the box is checked. By skipping that part of the code it shows even if the box is not checked.
User avatar
perarneflo
Bruji Friend
Bruji Friend
Posts: 18
Joined: Mon Aug 29, 2011 12:55 pm
Location: Oslo, Norway

Re: The magic IF tag and checkboxes

Post by perarneflo »

I'm afraid this doesn't answer my question.

By using [key:signed] I can display "Yes" or "No" if it is checked or not, but how do I use it to display something else like a picture only when it is checked?
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: The magic IF tag and checkboxes

Post by Nora »

Use this:

Code: Select all

<!--IFsigned <img src="coolpicture.jpg" name="[key:signed]" /> ENDsigned-->
IF statements aren't processed unless the tag appears so putting the [key:signed] tag into the 'name' attribute ensures that the IF statement is taken into account but also doesn't display the key but instead whatever image you choose.
Post Reply