We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24629
    • 370 Posts
    Hi,

    This might come in handy for someone. it helped me out just now so i thought i just share it
    I needed to get a collection of resources with getResources based on a Querystring.
    /folder/mypage.html?waarde=Hello
    what i did was make a tiny snippet called 'querystring' and put this in it
    $modx->setPlaceholders($_REQUEST,'querystring.');

    Then i put
    [[!querystring]]
    in the beginning of my page.
    After that i could get the value of 'waarde' (my value in the querystring) as a placeholder on anywhere the page like this [[+querystring.waarde]].

    This workes well with getresources
    [[!getResources? &parents=`1`   
                     &tvFilters=`waarde==[[+querystring.waarde]]` 
                     &includeTVs=`1` 
                     &tpl=`ListRowTpl`]]
    

    the result was a list of pages that have 'Hello' as value for the TV 'waarde'
    The querystring snippet also works with GET and POST from forms smiley

    Rdg
      • 40735
      • 119 Posts
      Clever! I'll use this. Thanks!