[[+content_image]]
A
A
Alexander Ivanov2015-12-02 16:07:17
MODX
Alexander Ivanov, 2015-12-02 16:07:17

How to sort in descending or ascending order in getPage?

Sorting alphabetically works with &sortby=`{"pagetitle":"ASC"}`, but not by number.

[[!getPage?
            &elementClass=`modSnippet`
            &element=`getResources`
            &limit=`18`
            &showHidden=`1`
            &tpl=`tovar`        
            &includeTVs=`image-tovar,old-price-tovar,price-tovar`
            &where=`{"template":6}`
---------
            &sortbyTV=`price-tovar`
            &sortbyTVType=`integer`
            &sortdirTV=`DESC`
---------
            &parents=`2`
            &includeContent=`1`
            &hideContainers=`1`
        ]]

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexander Ivanov, 2015-12-02
@cimonlebedev

Since nobody answered wow, I found the answer here ->
https://modx.pro/help/7077/#comment-49733

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question