Support » Plugin: Pods - Custom Content Types and Fields » Filtering Pods by custom fields

  • Resolved Rubidze

    (@rubidze)


    So I have created Pods with custom fields. I have numeric fields and Rerlationship field with custom Defined Options and multichoice type. I have created a template that shows all my Pods.

    Now, I would like to have multiple lists that pull data from same Pod type, but each to filter returned Pods by this relationship field. I don’t need users to do it on the front end, but maybe it can be defined somewhere in a shortcode or in a template. Any ideas how to achieve this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Rubidze

    (@rubidze)

    Answering my own question and posting it here for others.

    Filter by simple relationship field is done via shortcode:

    [pods name="MyPodName" 
    where="MyCustomFieldName.meta_value = 'ValueToLookup'" 
    template="My template name"]

    Morover, I found how to look for one or the other value:

    [pods name="MyPodName" 
    where="(MyCustomFieldName.meta_value = 'OneValueToLookup' 
    OR MyCustomFieldName.meta_value = 'OtherValueToLookup')" 
    template="My template name"]
    • This reply was modified 6 years ago by Rubidze.
    • This reply was modified 6 years ago by Rubidze.
    • This reply was modified 6 years ago by Rubidze.
    • This reply was modified 6 years ago by Rubidze.
    Plugin Author Jim True

    (@jimtrue)

    Glad you figured this one out. We document these ways of defining the fields in our Find Documentation (along with the video) and on our Shortcode documentation, specifically in the ‘where’ clause section.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering Pods by custom fields’ is closed to new replies.