Skip Navigation

[Resolved] how to use a view as a archive template

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

Problem: I would like preselect a taxonomy term filter in a parametric search View, and I would like to place that View on a taxonomy term archive URL.

Solution: The only way to preselect an option in a parametric search form is to use a URL parameter like yoursite.com/custom-search-page/?wpvcategory=uncategorized. If you try to place this custom search View on a taxonomy archive like yoursite.com/category/uncategorized, the "uncategorized" term will not be preselected in the taxonomy filter. You could automatically redirect the User to /category/uncategorized?wpvcategory=uncategorized using custom code to preselect the filter.

This support ticket is created 6 years, 10 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 6 replies, has 2 voices.

Last updated by meirk 6 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#608360

bsd

I'd like to use a parametric search view that i created as a archive view.
It means that when i click on "philosofy" category - i would be redirected in place of a category php template - to a toolset normal view with category "philosofy" parameter working (with the ability to swith to other categories from this view)
is that possible?

#608576

You must use a true URL parameter like ?wpvcategory=philosofy to show a custom search View with the "philosofy" category selected. Here is how you could accomplish something like this:
- Create a custom search page like yoursite.com/custom-search-page
- Create custom term "archive" links to yoursite.com/custom-search-page?wpvcategory=philosofy instead of yoursite.com/category/philosofy
- Create a custom search View, filtered by category, where category is set by a URL parameter like "wpvcategory"
- Place this View on the custom search page
- When the User clicks a link to this term "archive", they will be sent to yoursite.com/custom-search-page?wpvcategory=philosofy and the View will show philosofy results
- When the User changes the category filter to select "education" for example, the page URL will update to yoursite.com/custom-search-page?wpvcategory=education and education results will be shown in the View

#608624

bsd

Yes, i understand that, but i would like that the mysite/category/philosofy (native wp category url) also leads to this view

#608664

It is not possible to show the philosophy category preselected in a custom search View without using a URL parameter. Views does not allow it. As I said before:

You must use a true URL parameter like ?wpvcategory=philosofy to show a custom search View with the "philosofy" category selected.

I think you could implement some custom JavaScript that tests the current URL, and if the current URL is hidden link, then you could automatically redirect the user to hidden link.

#608671

bsd

sounds good
I am not a php pr js programmer - how should i do that? (for dinamcly redirect from all hidden link to hidden link?

#608689

We do not provide that type of custom code here in the forums, nor do we provide assistance with custom URL rewrite rules. Toolset is not designed to help you customize these things. If you need professional assistance with this redirection code, you may be able to connect with a skilled developer in our contractors portal: https://toolset.com/contractors/

#608691

thanks