• Resolved nathalie75

    (@nathalie75)


    Hi,

    I created a custom post type “person” and some custom fields like “name”, “city”, “country”, “email”.
    I am displaying the person list with a shortcode and a template, it’s working great.
    Now I’d like to have a search box and a drop-down to filter the list by country.
    I read your documentation: https://pods.io/docs/code/pods/filters/
    I think it’s what I need but I don’t understand what to do with the php code.
    Can you please give me some information about it?
    Thank you very much for your help!

    Nathalie

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @nathalie75

    Have you checked the video?
    It will give you some examples on how to implement filters in your query.

    Cheers, Jory

    Thread Starter nathalie75

    (@nathalie75)

    Hi Jory,

    which one do you mean?
    Thanks for your help.

    Nathalie

    Plugin Author Jory Hogeveen

    (@keraweb)

    The one on the page you’ve mentioned: https://pods.io/docs/code/pods/filters/

    EDIT: Sorry, you’d need this page: https://docs.pods.io/code/pods/find/

    Cheers, Jory

    Thread Starter nathalie75

    (@nathalie75)

    I will have a look, thanks!

    Thread Starter nathalie75

    (@nathalie75)

    Hi Jory,

    I am not a native english speaker and no PHP developer that’s why this video is very difficult for me to understand (except “don’t worry be happy!” ?? ).
    And I am not sure it would help me: my problem is not finding the right code but understanding what to do with this piece of code. Where shall I use it?
    Have a nice day.

    Nathalie

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @nathalie75

    I understand but please keep in mind that though we can support and help you with Pods, we will not build your customization for you. If you need custom work to be done and aren’t comfortable with coding yourself I’d advice you to hire a developer.

    What you need is to create a custom search box and let that input change your results created with Pods. Relatively easy task for a developer.

    The video I’ve posts is to help you how to modify the parameters in order to find the correct results. It will not generate a search box nor handle search input data. Such functionality is not available in Pods at the moment.
    You could take a look at FacetWP for such features! https://facetwp.com/

    Cheers, Jory

    Thread Starter nathalie75

    (@nathalie75)

    Hi Jory,

    ok. Facetwp is a bit expensive for me (or my customer) but it’s good to know it would be the best way.

    Many greetings

    Nathalie

    Plugin Author Jory Hogeveen

    (@keraweb)

    No problem, good luck with your project!

    Cheers, Jory

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @nathalie75

    I’m very sorry, I was just looking at the shortcodes parameters for another topic and suddenly found a feature I didn’t know that even existed through our filters parameter.

    If you just add the filters=1 argument (eg: Filters = true) it adds a search box on top of your results!
    You can even change the location with the filters_location parameter (before or after) and add a label through the filters_label parameter.

    Again, sorry for me not searching thoroughly enough. Even though I work with Pods for over 4 years I never actually use the shortcodes for my own projects.
    Hope it helps!

    Cheers, Jory

    Thread Starter nathalie75

    (@nathalie75)

    Hi Jory,

    thanks for the information.
    The search box is working for the post title (maybe for the post content too, I don’t know, I don’t have any) but not for the custom fields (for example in my case the city or country of the person) so it’s no great use for me.
    In the shortcode documentation https://pods.io/docs/learn/shortcodes/pods/ there is the information “A comma separated list of field names (relationship only fields)” in the “Details” for the “filters” parameter but it can not be since the filters parameter is boolean.
    Have a nice day.

    Nathalie

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @nathalie75
    Correct, for more search/filter types a shortcode isn’t flexible enough. You’d have to use PHP to create such views (as shown in the documentation pages).
    Cheers, Jory

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