Skip Navigation

[Resolved] How add filters with parametric search

This support ticket is created 8 years ago. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 12 replies, has 2 voices.

Last updated by Luo Yang 8 years ago.

Assisted by: Luo Yang.

Author
Posts
#403437

I am trying to: add filters with parametric search but i don't have solutions.
I have tree types : CORPUS, ROLE and PERSONNE.
CORPUS and PERSONNE are parents of ROLE.
I want to create a same view with filters. The filters can be fields and taxonomy of tree types.
But i don't succeed.
Pleaser, help me.
Th

#403593

Can anyone help me please ?

#403610

Dear nicolas,

It is not possible within Views plugin, Views is using wordpress Class "WP_Query" to query the posts,
http://codex.wordpress.org/Class_Reference/WP_Query
so all taxonomy and custom field should be setup in same post type. so you can not do this with Views:
The filters can be fields and taxonomy of tree types.

#403627

Thank you.
So if i understand, we can not display a view with parametric search on many differents types (child and parent).

Is this ?

If yes, how to do ? Because i need to display a page with filters from many types.

#403682

No, there is a misunderstand, if you are selecting posts of only one post type "ROLE", you can only add filters on the taxonomies and fields which are setup on the "ROLE" post type.

If you are selecting multiple post types(CORPUS, ROLE and PERSONNE), and filter by the taxonomies and fields which are setup on the "CORPUS" post type, the View will only return "CORPUS" posts in the result. it will not do what you are going to achieve.

Hope it is clear.

#403712

Thank you again for your response.
But it's not clear to me. Maybe it comes from my English (i'm a french).

1 / We can not have filters other than the type selected.
Example: I want to create a view of the CORPUS guy, I could not add filter as taxonomy from the type ROLE but simply to use filters from the fields of type CORPUS.
Is excat?

2 / If I select several types (CORPUS, ROLE and PERSONNE) together, is it possible to setup filters of "parametric search" on the fields three TYPES in order to display the result : the posts of type Corpus corresponding to the filters selected by an user ?
Example :

****parametric serch****
<checkboxes of titles 's posts of type "Personne" having the taxonomy (="redacteur")>
<checkboxes of taxonomies 's posts of type "CORPUS">
<fields of corpus>

****result****
i want to display all posts of type CORPUS with the filters selected by the user.

Sorry to you to make you repeat.

#404014

Q1) and Q2) Yes, you are right
And here is a document about "Parametric search – Letting Visitors Filter Content":
https://toolset.com/documentation/user-guides/front-page-filters/

Hope it help

#404035
SelectType.png
ParametricSearch.png
OutResult.png
FilterQuery.png
DisplayPage.png

1/ So i have a problem because on the page, the filter of parametric search "Langue" (=taxonomy on type CORPUS) don't display. Can i help me please ?

2/How to do in the result for displaying a distinct line by CORPUS 's posts ?

I did many screenshots.

Thank you for help.

#404109

Q1) It is abnormal, please check these:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still exists, please duplicate same problem in a test site, and fill below private detail box with login details, also point out the problem page URL and view URL, I need a live website to test and debug.

Q2) Could you describe the question with more details?
What is the distinct line by CORPUS 's posts?
If you want group the child "ROLE" posts by parent "CORPUS" post, you can setup a nested view:
1) Parent view select "CORPUS" posts, and display below child view, here you can add parameter search on taxonomy "Langue"
2) Child view select "ROLE" posts, filter with:
Select posts that are a children of the current post in the loop.
https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/
And put the parent view into a page, view the page in front-end

#404577

Thanks for the details, I can login your test site, I am trying to debug in your website, will feedback if there is any found

#405013

Since your website isn't in English, it takes time to debug.
Please check the problem view:
hidden link
in section "Query Filter", there is another taxonomy filter:
Sélectionner les publications avec taxonomie :
Langues parmi l'une de celles-ci : Bomu

Since there isn't any "CORPUS" post was assigned to taxonomy "Rôles", so Views returns empty result, and you can simply remove this filter. then the field "Langues" will be able display in the front-end filter form:
hidden link

But as I mentioned above, it won't work as you expected.

#405055

Hi,
Thank you for response.

So if I understand correctly, the filters of parametric search will not work because some corpus have no type 's relationship with type "Role" which the taxonomy is equal "redacteur-de-notice".
If this is, I will just connect all the corpus having no child relationship with post's type "Role" and taxonomy = "notice of editor".
Will it work after this step ?

#405299

Views will be able to return the results which satisfied the filter condition, and Views is using wordpress class WP_Query to query posts:
http://codex.wordpress.org/Class_Reference/WP_Query

And here is a document about:
Parametric search – Letting Visitors Filter Content
https://toolset.com/documentation/user-guides/front-page-filters/

you can test it the settings you mentioned above, but as I mentioned above, it does not work as you expected:
All taxonomy and custom field should be setup in same post type.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.