Answer the question
In order to leave comments, you need to log in
How to set up a filter in getPage modx?
1. Display resources via getPage here
2. Filter snippet + getPage code:
<?php
$out = array();
$category = isset($_GET['category']) ? strip_tags($_GET['category']) : '';
$categories = explode('|', $category);
if ($category != '') {
foreach ($categories as $categ) {
$out[] = 'category==%*' . $categ . '*%';
}
}
return implode(',' $out);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question