Blog Sections Open

Extending getResources tvFilters with Additional Comparison Operators

A practical parser-level tweak for older getResources setups that need richer TV comparisons such as <>, <=, and >= inside tvFilters.

One recurring limitation in older getResources setups was TV filtering. Developers expected SQL-style comparison operators, but in practice some operators were unsupported or interpreted differently.

This note explored a modified version of the snippet so tvFilters could work with a broader operator set, including not-equal comparisons.

Example goal

&tvFilters=`myTv<>5`

That should return all resources where the TV value is not equal to 5.

Compound example

&tvFilters=`myTv<>5||myTv=>20`

Supported operators in the modified approach

'==', '!=', '<=', '>=', '<>', '>', '<', '='

The wider lesson is still relevant: whenever a listing abstraction starts hiding too much of the actual filtering logic, test its operators carefully. Search, catalog filters, and faceted navigation all depend on those details behaving exactly as expected.

Newer post

Using Memcached to Speed Up Data-Heavy MODX Projects

A practical introduction to Memcached for older MODX and Evolution CMS installations that need faster object and page-level caching.

Older post

Caching Nested Snippet Output More Aggressively in Evolution CMS

A short performance note showing when nested snippet calls can stay cached and how that reduces unnecessary parser work on static sections.