Blog Sections Open
Filtering a Resource List with a Select Form in Evolution CMS
A select-based filter can drive resource output cleanly if the selected value is treated as the parent container for the next listing query.
A common Evolution CMS pattern is to use a form select as a lightweight filter: each option stores the ID of a container resource, and after submission the site displays the children of that selected container.
Basic idea
Submit the selected parent ID, validate it, and pass it into your listing snippet as the new source scope.
$parent = isset($_GET['parent']) ? (int)$_GET['parent'] : 0;
if ($parent > 0) {
echo $modx->runSnippet('Ditto', array(
'parents' => $parent,
'tpl' => 'listingRow'
));
}
Why this works well
- the form stays simple
- the resource tree remains your data model
- you avoid duplicating category logic in custom SQL
Recommendation
If the filter logic later grows beyond one parent selector, that is a good moment to move toward a richer filtering layer. But for container-based category switching, this is still a solid starting point.
Wrapping Ditto Output in Groups of Ten
When you need slider-like or grouped markup from Ditto, use the iteration counter to open and close wrappers at predictable intervals.
Linking Images from assets/images in TinyMCE with KCFinder
If KCFinder opens the wrong folder for links, fix the browser path setup instead of copying files around and breaking your media workflow.