Gevorg Hakobyan
Gevorg Hakobyan

Reputation: 327

Modx - Collections: Get Selections paginated with pdoTools

How to output Selections children with pagination using pdoTools (pdoResources & pdoPage) and getSelections. See my answer below.

Upvotes: 1

Views: 449

Answers (1)

Gevorg Hakobyan
Gevorg Hakobyan

Reputation: 327

Collections comes with its own snippet for Selections: the getSelections, which is by default dependent on getResources. If we want it to work with pdoTools and get paginated, we need to use pdoPage with &element=getSelections together with &getResourcesSnippet = pdoResources.

The code will look like this:

[[!pdoPage?
  &elementClass=`modSnippet`
  &element=`getSelections`
  &getResourcesSnippet = `pdoResources`
- other parameters
]]

Upvotes: 1

Related Questions