Sauter la navigation

[Résolu] Search with two different filters and have the results appear on another page

This support ticket is created Il y a 4 années. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Marqué : 

Ce sujet contient 7 réponses, a 2 voix.

Dernière mise à jour par Shane Il y a 4 années.

Assisté par: Shane.

Auteur
Publications
#1906205

I want two search boxes to appear on home. In the first one, a place can be searched (option created with a taxonomy) and in the second one, an activity (created as "entry type").
I would like to show the results taking into account what is selected in both filters and showing the result on another page when I hit the search button.
I have not been able to follow some examples that I have seen because options that appear in the examples do not work for me. I don't know if I need to install any plugin. I have the Views and Types activated.

#1906727

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Victor,

Thank you for getting in touch.

Can you let me know how far along you are on this ? Have you already created the search view ? If so how was it created? Once I know this I can then best guide you on the next step to proceed.

Thanks
Shane

#1909047

Hello! No, I have not created that view yet. I don't know how to create it so that in the first field you can search by places (they are fields of a taxonomy) and in the second field you can search by activities (which are input types) and apply those two filters at the time of look for

#1909465

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Victor,

Ok so the first thing I should clarify is that you cannot create a search based on a taxonomy custom field, only Post fields can be used in a search.

Another issue I see if that if you want to search your Posts you can only have 1 text search field and this will search through the Post title and the Post body. If you have the relevanssi plugin you can also include custom fields in the search.

Finally any other filters will be generated as a checkbox, select field or radio buttons.

With knowing this please let me know how you want to proceed so that we can get the search view setup.

Thanks,
Shane

#1909567

Ok, so the only question I have now would be how can I make the results show up on a different page and not go directly where I implement the search field?

#1911111

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Victor,

Actually what you need to do is create your view using the classic method by going to Toolset -> Views.

If you're not seeing this option go to Toolset -> Settings and scroll to editing experience. Select the 3rd option and the page will autosave.

Refresh the page and then go to Toolset->Views and you can create your search view there.

Finally to separate the search and the results you will go to the page where you want to have the search and just using the Classic Editor block click on the fields and views button.

This will allow you to insert your view, all you have to do is to select Search only. A similar setup is required for the results only page.

Please let me know if this helps.
Thanks,
Shane

#1914993
toolset3.PNG
toolset2.PNG
toolset1.PNG

The problem I have is that I do not get any option to show only search or only results. Maybe I am missing something to install.

#1917689

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Victor,

In this case you will need to use the shortcode manually.

On your page that you want to have the search only you will use this shortcode below.
[wpv-form-view name="search-view-with-map" target_id="196"]

Replace "search-view-with-map" with the name of your view and 196 with the page id that the results will be on.

Secondly on the results page just add.
[wpv-view name="search-view-with-map" view_display="layout"]

Likewise just replace "search-view-with-map" with the name of your view.

Please let me know if this helps.
Thanks,
Shane