Home > Advanced Functions > Conditional Content > Conditional Content by Query

Conditional Content by Query

The 'conditional content by query'' function is similar to the 'conditional content by user' function, however instead of selecting specific users from a list, a query determines which users the content will be visible for. Follow the steps below to insert a condition based on a query:

1. Select the page that you want to add conditional text to.


2. Click the 'More' button on the toolbar to show additional functions.


3. Click the   icon to display the 'Insert Condition' dialog. Select the 'SQL' tab.


4. Enter the query that will generate a list of users. The query should generate one column which is the 'username' column. Click 'Insert'

5. The conditional content will be contained within orange start and end tags. In the example below, a message will be displayed if a user is logged in and is assigned to the 'admin' security group.



6. If the user is logged in and the username is assigned to the 'Admin' group, they will see the conditional message:


Notes:
- If you want to remove a condition, just delete the start and end tags.
- If you want to edit the query within the condition, double click the 'IF' tag and revise the query.
- Conditions can include pretty much anything including text, images, flash animations, variables, iframes, etc.


See also

Conditional Pages
Conditional Content by Skin
Conditional Content by User
Conditional Variables