Conditional Types
There are 2 types of conditionals: Positive Conditional and Negative Conditional.
-
Positive Conditional is a condition that will display the widget when
any of the items (page, device, or URL) in the value are met.
- Negative Conditional is a condition that will display the widget when none of the items in the value are met.
Defining Values
Format
More information about page types can be found on the page: Page Types and Names
{{item1, item2, itemN}}
!{{item1, item2, itemN}}
- item refers to a Page, Device, or URL
- Separate each item with a comma
Item: Page Type
| Page Type | Value | Description |
|---|---|---|
| Homepage | homepage | Main page |
| Search By Label | search_by_label | Label page |
| Search By Query | search_by_query | Search page |
| Search By Published | search_by_published | The page when user browse blog posts |
| Post | post | Post page |
| Page | page | Blog page |
| Archive | archive | Archive page |
| Error | error | Error page |
More information about page types can be found on the page: Page Types and Names
Item: Device
| Device | Value | Description |
|---|---|---|
| Desktop | desktop | Desktop device |
| Mobile | mobile | Mobile device |
Item: URL
For URL items, the system will ignore protocol and www.
The following three URLs will be considered the same:
https://www.domain.com
http://domain.com
domain.com
Examples
Example of Positive Conditional
{{homepage}}
Displays the widget only on the Homepage type page.
{{homepage, post}}
Displays the widget only on Homepage or Post pages.
Example of Negative Conditional
!{{homepage}}
Displays the widget if the active page type is not Homepage.
!{{homepage, post}}
Displays the widget if the active page type is not Homepage and Post.
!{{search_by_label, mobile}}
The widget will be displayed if the active page type is not Search By Label and
the device used is not Mobile. Here, according to the negative conditional rule,
even if the active page type is not Search By Label, if the device used is Mobile,
the widget will not be displayed.
!{{page, https://www.domain.com/2022/04/title.html}}
Displays the widget on page types other than Page and the URL is not
https://www.domain.com/2022/04/title.html.