Skip to content

Conditions and Filters

Apply conditions to the source content during fetching and/or rendering phase.

It's important to understand the different types of conditions in dynamic content, their differences in execution time or dynamic values support, and learn how to combine them effectively.

TypeDescriptionExecution TimeDynamic Support
Query ConditionsProvided by each source individually.QueryPartial
Dynamic ConditionProvided globally as part of the Dynamic Content core workflow.RenderNone
Access ConditionProvided globally as part of the Essentials Access addon workflow.RenderFull

Query Conditions

Filter and/or order query conditions are rules, applied during a query execution, that the content must evaluate to in order to be included in the fetched results. The conditions are provided and supported by every source individually.

Query Conditions

Filter Condition Details

Filter Condition

Query Filter Condition

SettingDescriptionDynamicRequired
NameA name to better identify this condition.
StatusShould this condition be evaluated.
FieldThe field of the currently evaluated record to use for the condition evaluation.
OperatorThe operator for the evaluation, see full list bellow.
-- Is NullThe field must be null.
-- Is not NullThe field must not be null.
-- Is emptyThe field must be empty.
-- Is not emptyThe field must not be empty.
-- Equal ToThe field must be equal to the specified value.
-- Not Equal ToThe field must not be equal to the specified value.
-- Less thanThe field must be less than the specified value.
-- Greater thanThe field must be greater than the specified value.
-- Less than or equal toThe field must be less than or equal to the specified value.
-- Greater than or equal toThe field must be greater than or equal to the specified value.
-- Starts withThe field must start with the specified value.
-- Ends withThe field must end with the specified value.
-- LIKEThe field must match a pattern specified in value.
-- LIKE %%The field must match a pattern specified in value which will be wrapped with % wildcard that represents zero, one, or multiple characters.
ValueThe static or dynamic value that the field is being evaluated with.

Filter Evaluation Logic

Query Filter Conditions

SettingDefaultDescription
Filters[]The list of filter conditions applied during the query execution.
ModeANDThe filter conditions evaluation logic, AND, OR, or Custom.
-- ANDAll conditions must evaluate as true.
-- ORAt least one condition must evaluate as true.
-- CustomReference a condition with brackets {} and it index number, e.g. {1}. Combine conditions with the logic operators AND|OR, e.g. {1} AND {2} OR {3}. Alter the execution order with parenthesis (), e.g. {1} AND ({2} OR {3}) where the conditions 2 and 3 will be evaluated first.
Order Condition Details

Order Condition

Query Order Condition

SettingDescriptionDynamicRequired
NameA name to better identify this condition.
StatusShould this condition be evaluated.
FieldThe field of the currently evaluated record to use for the condition evaluation.
DirectionThe ordering direction, ascendent ASC or descendent DESC.

Dynamic Condition

Part of the Dynamic Content core workflow, Dynamic Condition is set during a source mapping to determine should the element be displayed. The amount of conditions is limited to one, and cannot use dynamic content for more advanced evaluation.

Dynamic Conditions

Access Condition

Part of the Access Addon workflow, Access Condition has the same functionality as the Dynamic Condition, but with support for dynamic content, multiple rules and custom evaluation logic. You can opt to use it instead as per higher possibilities.

Access Conditions

Execution Performance

With Query Conditions, the content is fetched pre-filtered and the load in memory minimum, e.g. from 500 items 20 would be loaded, then 20 elements rendered.

With Dynamic or Access Condition, all content is fetched into memory, then the elements are filtered during runtime, e.g. from 500 items 500 items would be loaded, then 500 elements conditioned during the pre-rendering phase, but only 20 rendered.

To optimize page loading speed and minimize the risk of memory errors, Query Conditions are the preferred method and should always be used if available. If not available, the next best approach is to combine different types of conditions. This is because the more data loaded into memory and processing required during runtime, the slower the page loads and the higher the risk of running into memory errors.

Combined Conditions

Not all queries support conditions, and if do most likely do not support evaluating dynamic values. In such situations a good strategy is to combine Query Conditions with Dynamic or Access Condition. In practice that would mean load the minimum amount of content into memory, e.g. load items from a specific category, then further filter down those during the rendering.

Pagination Errors

Be aware of the pagination (offset and limit) while combining conditions as the results might not be what you expect. For example, you might set a limit condition of 20, but the final filtered result be 18.

As a rule of thumb, when an exact amount of items is required do not combine conditions.