We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29076
    • 615 Posts
    I need to sort out and show all documents with pagetitle starting on the letter P (in this example) using getResources. In Evo with Ditto I had this call:
    [!Ditto? 
    &parents=`3` 
    &depth=`0` 
    &display=`all` 
    &sortBy=`pagetitle` 
    &sortDir=`ASC` 
    &extenders=`glossaryFilter` 
    &filterBy=`P` 
    &tpl=`photoListSort` 
    &hideFolders=`1` 
    &filter=`hidemenu,0|introducedWhere,,1`!]


    How can this be done in Revo with getResources?

    I have tried different versions of &where-coding, but I just don't understand enough of how that works.

    My call to day:
    [[getResources?
    &parents=`3` 
    &depth=`3` 
    &tpl=`photoListSort` 
    &limit=`0` 
    &hideContainers=`1` 
    &sortby=`{"description":"ASC"}`
    &includeTVs=`1` 
    &includeTVList=`img_close, img_whole` 
    &tvPrefix=`` 
    ]]


    I have tried
    &where={"pagetitle:REGEXP" : "^([p]){1}(.*)$","isfolder:=":0}
    Doesn't work.
    &where=`{"pagetitle:LIKE" = "P%"}
    Doesn't work.

    Hopefully someone can help me here.

    This question has been answered by sottwell. See the first response.

    [ed. note: Sylvaticus last edited this post 10 years, 4 months ago.]
      I think, thererfor I am! But what I am, and why...?
    • discuss.answer
      Maybe this?
      &where=`{"pagetitle:LIKE":"P%"}`
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 29076
        • 615 Posts
        Quote from: sottwell at Feb 20, 2014, 09:03 PM
        Maybe this?
        &where=`{"pagetitle:LIKE":"P%"}`
        Fantastic! Thank you so much. Just a small detail, but it's all it take to make it work or not.

        For those wondering; If you want to test against two letters, write this:

        &where=`{"description:LIKE":"e%","OR:description:LIKE":"f%"}`
          I think, thererfor I am! But what I am, and why...?