Conditional Content supports a wide selection of conditions, such as device, user groups, date ranges, languages, menu items, and more. These conditions define when or to whom you want to show the content.

By clicking on the Conditional Content editor button, you can select inline rules or a reusable Condition Set, as part of the "Conditions" tab.

If all of the conditions are set to Ignore, the piece of text will show up (when using {show}) or be hidden (when using {hide}) on all pages. As soon as you set one or more of the conditions to Include or Exclude, the piece of text will be limited to the specified conditions.

Free and Pro Rules

Free and Pro both support Menu Items, Home Page, Date, Access Levels, User Groups, Languages, and Devices. The other rule types require Pro.

Both editions can reference reusable Condition Sets. The same edition limits apply inside those sets, including nested sets: a Pro-only rule does not become available by putting it in a Condition Set. Use only supported rules in sets used by Free; unsupported rules are ignored.

Matching Method

As mentioned above, you can use and combine any of the conditions. You don't have to just use one.

To control how multiple conditions are applied, there is a Matching Method option. This determines whether all or any conditions need to be matched:

  • ALL: Will be published if ALL of the below conditions are matched at the same time.
  • ANY: Will be published if ANY (one or more) of the below conditions are matched at any time. This will add a matching-method="any" attribute in the plugin tag.

Condition rules where "Ignore" is selected will be ignored.

When combining exclusions, use ALL if every exclusion must hold. ANY passes when at least one rule matches, which can include pages you intended to exclude.

Condition States

Each condition type has three possible states/options.

  • Ignore (default)
  • Include: the content will be shown/hidden in all circumstances that do match that condition.
  • Exclude: the content will be shown/hidden in all circumstances that do not match that condition. This prefixes the selection value with !, for example menuitems="!101,102". Boolean rules use false, such as homepage="false".

By default all conditions are ignored, meaning the condition is not used.
To use an condition, you set the option to Include or Exclude depending on the desired effect.

Condition Sets

Conditional Content comes with the ability to save and reuse complete Condition Sets. These sets can contain one or more rules in all sorts of combinations.

You can either create a new Condition Set and use that. Or use an already existing Condition Set.

The same Condition Set can be reused in Conditional Content and consumed by Advanced Module Manager Pro, Content Templater Pro, and ReReplacer Pro.

Another advantage is that you can create complex conditions containing multiple rules that are grouped and mix different matching methods (ALL / ANY). While the syntax remains sweet and short. Just the condition="..." attribute is necessary.

And a third advantage is that you can name the condition set to make it easier to understand what is going on.

For instance, you might struggle a bit when trying to understand:

{show menuitems="23,57,108"}...{/show} 

Placing this in a well-named Condition Set will save you some brain cells every time you go back to that content:

{show condition="Legal Pages"}...{/show}

Condition Sets provide additional rule types and the full settings interface. Some extra settings, including child-item selection, can also be entered manually in inline tags. See the inline rule reference for the supported attributes, settings, and editor-button availability.