We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42753
    • 17 Posts
    I use Peoples snippet to output a list of users. I need to filter them by an extended profile field. How can I achieve it?

    This question has been answered by m.engel. See the first response.

      • 42753
      • 17 Posts
      Looked into the source code of the snippet and found there "&where" property. Tried to use it as in getResources snippet:

      [[!Peoples? &where=`{"Profile.id:=":30}`]]


      and it works.

      But I don't undersnand how to get access to extended fields. [ed. note: webstyle last edited this post 13 years, 6 months ago.]
        • 42753
        • 17 Posts
        In a separate snippet I tried:

        $query = '"showprofile":"on"';
        $c->where(array('Profile.extended:LIKE' => '%'.$query.'%'));


        and it works fine.

        But I can't get it to work in Peoples &where property. Any help would be appreciated.
        • discuss.answer
          • 40706
          • 128 Posts
          It should work as you did

          [[!Peoples? &where=`{"Profile.extended:LIKE":"%\"showprofile\":\"on\"%"}`]]


          is probably right, cant test it now
            • 42753
            • 17 Posts
            Quote from: m.engel at Mar 05, 2013, 03:54 PM
            It should work as you did

            [[!Peoples? &where=`{"Profile.extended:LIKE":"%\"showprofile\":\"on\"%"}`]]


            is probably right, cant test it now

            Thanks you a lot, it works fine. I tried so, but didn't think to comment out the quotes.