We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17422
    • 225 Posts
    Hi
    i use getResources for list page with a Get Value
    [[!getResources? &parent=`2` [[!returnValeurGet]] &tpl=`bloc_list_artiste` &tpl_10=`bloc_list_artiste2` &tpl_20=`bloc_list_artiste2` &tpl_30=`bloc_list_artiste2` &tpl_40=`bloc_list_artiste2`  & sortby=`pagetitle` &sortdir=`ASC` &limit=`100`]]
    


    snippet returnValeurGet =>
    $lettre=$_GET["lettre"];
      if (isset($lettre)) {
    return '&where=`{\"pagetitle REGEXP [^'.$lettre.']\"}`';
    //     return "&where=`{\"pagetitle:LIKE\":\"".$lettre."%\"}`";
          }
    


    i want use RegExp but no work.

    How can i do this for that getResources return their resources with $lettre in the pagetitle value.

    ex : i have a resource with a pagetitle : Bonjour Laurent

    and when a is $lettre=L

    i want getResources return this page
      • 22303 MODX Staff
      • 10,725 Posts
      Why are you escaping the quotes in the JSON of the where property?
        • 17422
        • 225 Posts
        because I made a copy and paste the line below

        it is a mistake on my part


        the regexp not work but i change the where properties without regexp
        return "&where=`{\"pagetitle:LIKE\":\"".$lettre."%\", \"OR:pagetitle:LIKE\":\"% ".$lettre."%\"}`"
        


        work fine smiley