Skip Navigation

[Resolved] Adding link filters to Search View

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to include some text links in a custom search View that will allow Users to filter the results using another method.

Solution: Views doesn't offer text link filters, so combining these with your existing filters isn't currently possible. However, you can use a View of taxonomy terms to create links to filtered results.

<a href="/custom-search-page/?wpv-category=[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>
This support ticket is created 4 years, 6 months 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by jean-francoisB 4 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1363685
Capture d’écran, le 2019-10-17 à 10.24.27.png
Capture d’écran, le 2019-10-17 à 10.24.41.png
category-select.jpg

Hi,

I have a listing website with a Search View with search form (hidden link). Everything works well but I would like to add a new filter at the bottom of the search form where people could click on links of listing categories and get the result under. I already have the listing category filter in a drop-down menu but I would like to add something a bit more visible and intuitive for visitors by giving them the option to just clink on a category from the list and show them all the listings in that specific category.

Because I'm already using the listing category filter, Toolset grey out this option when I try to add a new filter;
When I try to create a new filter, the only options that I'm getting are : Select drop-down - Select multiple - Set of radio buttons - Set of checkboxes. I have no option like list of links of something similar.

If you can give me some tips on how I can make this, that would be awesome. I'm sure it's not that difficult but I just don't know where to start and do it the right way.

Thank you for your help!

#1363795

Hi, this type of filter isn't offered in Toolset and unfortunately I don't have an easy solution for you because:
1. Toolset doesn't offer a text-link based filter of any kind.
2. Toolset doesn't offer redundant filters in the same custom search. So you can't include two different styles of filter for the same filter criteria.

What you could do is create a View of terms and output a link to each term's archive, but that will not necessarily include the other search criteria your visitors have already selected in the custom search View. That would require some custom programming that falls outside the scope of support in the forums.

Let me know if you have questions about that.

#1363857

Hi,

Thank you very much for your answer and what you say make sense to me.

But actually, what I would like is when someone clicks on one of the categories, the other search criterias don't have to be considered. Mostly what I want is giving two search options on the same page for my visitor:

1) Using the search engine with filters
OR
2) Clicking on a category link and see all listings in that category

But I would like in both situations that the result appears under and not on different pages.

Do you think it's something possible or those links will have to open a new page showing a different view with the specific term?

Thank you very much!

#1365099

Okay great, thanks for the additional information. Yes, I think it is possible to have the results appear below the links, however there are some limitations I want you to be aware of. For example, the page must reload to display the results. These text links will not work with AJAX. This is how I would set it up:
- First, create a custom search View with a keywords text search filter, a categories filter, a specialties filter, and a distance filter.
- AJAX is not supported. The View must refresh the page to load the results. I recommend you require a submit button too.
- The advanced setting "Show only available options for each input" will not be integrated with these text links, so I do not recommend using that feature.
- Use the Loop Editor and Loop Wizard to design each item in the results however you want, and test the custom search View to see if everything is working as expected for the non-text filters.
- After you confirm the other filters are working as expected, create a View of the Categories taxonomy. No Query Filters or pagination should be applied to this View.
- In the Loop editor of this View, create HTML link tags for each term in the loop. These links will reload the page with only the corresponding category term filter in the URL parameters. For example, if you use the Category "select" filter in the main search View to search for "Charities and Associations", the page URL parameters will update to show which item was selected. Your site URL might look like this after you submit the search form:

<em><u>hidden link</u></em>

In your View of terms, you will create a link tag using the slug of the term and the title of the term, and place it in the loop output:

<a href="/custom-search-page/?wpv-category=[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>

- Now insert this View of terms inside the custom search View's Output Editor panel between the [wpv-filter-meta-html] and [wpv-layout-meta-html] shortcodes. If you cannot see the Output Editor panel, scroll to the top of the screen and click "Screen Options". You can activate the Output Editor panel here.

If you would like to collaborate on a demo site, sign up for free at our sandbox site https://discover-wp.com using the email address associated with your account. I can add you to a collaboration site where we can work together and you can see exactly how this would work.

#1370471

Thank you for your help! I will try this soon and see how it goes. Thank you very much for your help! Much appreciated!

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