Skip to content

Events

fpOnFieldFilter

ParameterDescription
nameThe name of the field being filtered. This identifies which field the filter applies to.
operatorA reference to the operator being used for the filter (e.g., =, !=, FIND_IN_SET). It can be modified by event listeners.
valueA reference to the value being used for filtering. This can be modified by event listeners to change the filtering criteria dynamically.

Example

php
if ($modx->event->name === 'fpOnFieldFilter' && $name === 'categories') {
    $modx->event->params['operator'] = 'FIND_IN_SET';
    if (!is_array($value)) {
        $modx->event->params['value'] = [$value];
    }
}