Conditional display
{if:VARIABLE OPERATOR VALUE}...text you want to display or remove...{/if}
You can use any variable from the user profile (so name, email, subid, userid or any other custom field you created) You can use the operators:
- = (which means equal)
- != (which means different)
- > (superior to)
- < (inferior to)
- ~ (contains the string)
- !~ (does not contain the string)
The test is case-insensitive.
You can also use values returned by another tag in the conditional display by using the format: {if:var.{yourtaghere}=3}...{/if} For example if you created a field on Community Builder: {if:var.{tagcb:cb_gender}=M}this text will be displayed for Male{/if}
You can also test based on Joomla profile values using the format: {if:joomla.joomlafield=value}...{/if}
{if:userid!=0}You're one of our registered users!{/if}
{if:userid=0}What? You're not a registered user?? Let's create your account now!{/if}
If you create a custom field with checkboxes to select user's interests, you should then use the operator "~" as a user may have several interests. {if:mycats~sports}Here I will display sports articles{/if}
{if:occupation= }You didn't enter your occupation... don't forget to update your profile on our website!{/if} (You should add a space after the operator)
If you want to display some text according to the list subscription, you can use the tag giving all lists the user is subscribed to. Then search if your list name is inside: {if:var.{list:names}~your first list name}Message for your first list{/if} {if:var.{list:names}~your second list name}Message for your second list{/if}