Skip to content

sortby order of ids defined in "resources" #192

Description

@pepebe

How can I switch off default sortby/sortdir.

            [[!pdoResources?
                &parents=`20`
                &resources=`45,62,4`
                &tpl=`textbausteine_tpl`
                &tplWrapper=`textbausteine_tplWrapper`
                &showHidden=`1`
                &includeContent=`1`
            ]]

I want to list the resources in exactly the same order as stated in the resources parameter.

There is an old thread that describes that problem, but the solutions are all hacky...

http://forums.modx.com/index.php/topic,62808.msg356290.html

There is also a solution in RTFM for getResources:

&sortby=FIELD(modResource.id,[[*templateVariable]])&sortdir=ASC`

https://rtfm.modx.com/extras/revo/getresources

But pdoTools doesn't support this.

Finally there is a PR by oliver Haase Lobinger (not merged) for a solution in getResources:

opengeek/getResources#101

Is there any chance this can be solved in the near future?

Cheers,

Patrick

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions