You can restrict or grant access to your desired content by placing either {show}
or {hide}
plugin tags around it.
Inside the opening tag, enter the desired conditions with a condition="value"
syntax, which you might recognise from how html works.
Basic Examples
For example, to show a piece of text only to guests (not logged-in visitors), you can do:
{show accesslevels="Guest"}You are not logged in yet!{/show}
Each condition can also have multiple values, separated with a comma. For example, to hide a piece of text during the weekends:
{hide days="6,7"}Call us now!{/hide}
You can place any type of content between the {show}
and {hide}
plugin tags. So also rich content and images. And you can place these {show}
and {hide}
plugin tags right into your WYSIWYG editor.
Alternative Content
Conditional Content also offers the ability to display alternative content when the set conditions are not met. This can be accomplished by either using a {show-else}
or {hide-else}
tag.
This example displays a message based on whether a visitor is or is not logged-in.
{show accesslevels="Guest"}
You are not logged in yet!
{show-else}
You are logged in now!
{/show}
Multiple Conditions
You can also combine multiple conditions and use them at the same time:
{show accesslevels="Guest" device="mobile"}
This text will only show for not-logged visitors from mobile devices.
{/show}