I’m thinking about a solution for the following problem: I have several documents in a parent folder. These documents have various properties that are realized using TVs.
I would like to create a form in which the user can make various settings. After the form has been sent, the corresponding documents should then be displayed using pdoResources.
But how do I send the settings made in the form to pdoResources?
Does anyone have an approach?
So pdoResources should get the settings tvFilters and so on from this form.
The settings from from form are available in the PHP super globals $_POST, $_GET, $_REQUEST.
You can read the values from these super globals in a snippet and sanitize them.
Version 1: With the submitted values you create the &tvFilters string (or the condition for the &where property) in your snippet and return the value directly.
Version 2: You read the submitted values in a snippet and create placeholders ($modx->setPlaceholder('myPlaceholder', $some_value);) that are used later in the pdoResources call.