Conditional Placeholders

RSDirectory! offers the possibility to set up conditional placeholders. This allows you to display any information (for example add some text, other field's placeholders) only if a value was submitted in a certain field. You'll need to use the following syntax:

{if field-name}Add any information here, including field placeholders: {another-field}{/if}

This syntax is available in all RSDirectory! areas where the use of placeholders is possible:

Example:

{if {field_name_1} == {field_name_2}} This text will be displayed if the field_name_1 is matching field_name_2 value{/if}

{if {field_name} == Your desired value} this text gets displayed only if the placeholder has the "Your desired value" value {/if}.

{if value == {field_name}} this text gets displayed only if the placeholder has the "Your desired value" value {/if}.

{if {field_name}} This text will be displayed if there is a value added {/if} - The string found within the {if} syntax will not show if the field has no value.

For older versions, the syntax would be:

{if field_name} This text will be displayed if there is a value added {/if} - The string found within the {if} syntax will not show if the field has no value.

The {if} clause also accept the following operators:

<= , >=, <>, <, >, !=, =,==,===, <-, ->

Nested conditionals

These special {if} conditions can be nested, as in the following example:

{if field-name-1}

{if field-name-2}Add your information here{/if}

{/if}

Note: Make sure to replace field-name with your field's actual internal name.

 

8 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that