Skip Navigation

[Resolved] Creating 2 Custom Search Filters by Relationship in Toolset Blocks

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 1 voice.

Last updated by Minesh 3 months, 4 weeks ago.

Assisted by: Minesh.

Author
Posts
#2803251
Print search.png

Tell us what you are trying to do?

Hello support team, I would like to know if it is possible to add two relationship-based filters in a single “view search.” I need to perform an intersection between the fields, but once I add the first relationship filter, the option to add another relationship filter is no longer available. I also tried duplicating the existing filter and assigning different settings, but that did not work.

I came across some forum content suggesting a custom PHP approach, but after a recent update, the linked page returns a 404 error. Could you please point me in the right direction?

Here’s my specific scenario: I need to implement a search filter for academic theses. Every thesis has both a “research line” and a “concentration area.” I have already created the relationships, but I can only add one of the two relationship-based filters to the search.

Thank you in advance.

Is there any documentation that you are following? No

Is there a similar example that we can see? no know

What is the link to your site?

hidden link

#2803256

Below are the codes for the search field generated by the visual editor.

<!-- wp:toolset-views/custom-search-filter {"field":{"shortcode":"wpv-control-post-relationship","name":"Post relationship or repeatable field groups owner","params":[],"present":"post_relationship_mode"},"shortcode":"[wpv-control-post-relationship ancestors='linha-de-pesquisa@tese-e-dissertacao-linha-de-pesquisa.child' url_param='wpv-relationship-filter' type='select']","shortcode_data":{"attributes":{"ancestors":"linha-de-pesquisa@tese-e-dissertacao-linha-de-pesquisa.child"}},"style":{"cssClasses":[]},"labelText":[],"content":"[wpv-control-post-relationship ancestors='linha-de-pesquisa@tese-e-dissertacao-linha-de-pesquisa.child' url_param='wpv-relationship-filter' type='select']\u003cdiv class=\u0022form-group\u0022\u003e\u003c!\u002d\u002d ## \u002d\u002d\u003e\u003clabel class=\u0022wpv-custom-search-filter__label\u0022 for=\u0022wpv-relationship-filter-linha-de-pesquisa\u0022\u003eLinhas de Pesquisa\u003c/label\u003e\u003c!\u002d\u002d ## \u002d\u002d\u003e\u003cspan class=\u0022wpv-custom-search-filter__input\u0022\u003e[wpv-control-post-ancestor ancestor_type='linha-de-pesquisa@tese-e-dissertacao-linha-de-pesquisa.child' url_param='wpv-relationship-filter' type='select']\u003c/span\u003e\u003c/div\u003e[/wpv-control-post-relationship]"} -->
<div class="wp-block-toolset-views-custom-search-filter wpv-custom-search-filter wpv-custom-search-filter-label-top" data-toolset-views-custom-search-filter="1"><div>[wpv-control-post-relationship ancestors='linha-de-pesquisa@tese-e-dissertacao-linha-de-pesquisa.child' url_param='wpv-relationship-filter' type='select']<div class="form-group"><label class="wpv-custom-search-filter__label" for="wpv-relationship-filter-linha-de-pesquisa">Linhas de Pesquisa</label><!-- ## --><span class="wpv-custom-search-filter__input">[wpv-control-post-ancestor ancestor_type='linha-de-pesquisa@tese-e-dissertacao-linha-de-pesquisa.child' url_param='wpv-relationship-filter' type='select']</span></div>[/wpv-control-post-relationship]</div></div>
<!-- /wp:toolset-views/custom-search-filter -->

<!-- wp:toolset-views/custom-search-filter {"field":{"shortcode":"wpv-control-post-relationship","name":"Post relationship or repeatable field groups owner","params":[],"present":"post_relationship_mode"},"shortcode":"[wpv-control-post-relationship ancestors='area-de-concentracao@tese-e-dissertacao-area-de-concentracao.child' url_param='wpv-relationship-filter' type='select']","shortcode_data":{"attributes":{"ancestors":"area-de-concentracao@tese-e-dissertacao-area-de-concentracao.child"}},"style":{"cssClasses":[]},"labelText":[],"content":"[wpv-control-post-relationship ancestors='area-de-concentracao@tese-e-dissertacao-area-de-concentracao.child' url_param='wpv-relationship-filter' type='select']\u003cdiv class=\u0022form-group\u0022\u003e\u003c!\u002d\u002d ## \u002d\u002d\u003e\u003clabel class=\u0022wpv-custom-search-filter__label\u0022 for=\u0022wpv-relationship-filter-area-de-concentracao\u0022\u003eÁreas de Concentração\u003c/label\u003e\u003c!\u002d\u002d ## \u002d\u002d\u003e\u003cspan class=\u0022wpv-custom-search-filter__input\u0022\u003e[wpv-control-post-ancestor ancestor_type='area-de-concentracao@tese-e-dissertacao-area-de-concentracao.child' url_param='wpv-relationship-filter' type='select']\u003c/span\u003e\u003c/div\u003e[/wpv-control-post-relationship]"} -->
<div class="wp-block-toolset-views-custom-search-filter wpv-custom-search-filter wpv-custom-search-filter-label-top" data-toolset-views-custom-search-filter="1"><div>[wpv-control-post-relationship ancestors='area-de-concentracao@tese-e-dissertacao-area-de-concentracao.child' url_param='wpv-relationship-filter' type='select']<div class="form-group"><label class="wpv-custom-search-filter__label" for="wpv-relationship-filter-area-de-concentracao">Áreas de Concentração</label><!-- ## --><span class="wpv-custom-search-filter__input">[wpv-control-post-ancestor ancestor_type='area-de-concentracao@tese-e-dissertacao-area-de-concentracao.child' url_param='wpv-relationship-filter' type='select']</span></div>[/wpv-control-post-relationship]</div></div>
<!-- /wp:toolset-views/custom-search-filter -->

#2803334

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

At the moment Toolset offers to search with one post relationship.

More info:
- https://toolset.com/course-lesson/creating-a-custom-search/#how-to-search-by-post-relationships

Since this kind of filtering is not currently supported out-of-the-box, you're welcome to submit a feature request using the following link:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

For more personalized assistance around customization, you can also consider hiring a professional from our list of recommended contractors:
- https://toolset.com/contractors/