W
W
weredy2016-04-05 10:20:34
MODX
weredy, 2016-04-05 10:20:34

How to make a filtering form for the collections page?

I just started to learn MODX, googling only led to a solution using the paid mSearch plugin. Maybe there is something else? Maybe it is implemented by some other plugin?
Ideally, of course, understand how to process the get request from the form yourself and generate a page in accordance with it, but again, I just started learning and I would be very grateful if someone points in the right direction. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Shkaev, 2016-04-08
@weredy

There is a good tagmanager snippet, it works with GER, ajax filtering, working with TV
If you know php, a snippet is created, any php code is written in it.
and process it the way you want.
The craziest way to call another snippet in a snippet, like getresources , and pass it
in MODx has a powerful API. for example getCollection,

$q = $modx->newQuery('modResource', array('id:>' => 0, 'template' => 3));
$res = $modx->getCollection('modResource', $q);
var_export($res);

there is an option to directly access the database through pdo gadgets, to the default site_content fields. with tv it is already more difficult to join 2 tables
$q = $modx->newQuery('modResource', array('id:>' => 0, 'template' => 3));
$q->select('id,pagetitle');
if ($q->prepare() && $q->stmt->execute()) {
    while ($row = $q->stmt->fetch(PDO::FETCH_ASSOC)) {
        var_export($row);
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question