Hi,
I have an archive where I have a section displaying search form.
I'd like to display the search form related to the archive on the frontpage. I know this tutorial:
https://toolset.com/documentation/user-guides/front-page-filters/
I cannot see there how to do it. The page displaying the archive is not a regular page which can be selected as a target where to display the results.
Yes, this requires a View, that is placed on a Page which you can choose as a target when inserting the View or Widget.
There is no possibility to link to an archive as a custom search like this.
It could be possible by crafting custom links that lead to the archive and pass the ?query_parameters to the URL which the Archive listens to.
However, that is not possible with the GUI process as inserting the View or Widget.
It would require you to build let's say a select field with a few values (which you can produce with a RAW Views Output for example), which then leads to the archive passing the selected values in the ?query_parameters to the URL which the Archive listens to.
Please let us know if you would need help with that.
Hi Beda,
1. Sounds promising. So I'd see it as a simple form: a select field and a button. The select field should display categories (taxonomy) assigned to a given custom post. Clicking on the button should redirect to the archive page with filtered results based on the url parameter. I'd be grateful for hints.
2. This actually raises another question: what is an advantage of using WordPress Archive over standard view, if the latter one seems to be more flexible?
Best
Clicking on the button should redirect to the archive page with filtered results based on the url parameter. I'd be grateful for hints.
It really depends on the complexity of the search form. If it's just the one select field filter, you could use this other ticket as a guide:
https://toolset.com/forums/topic/create-a-dropdown-box-with-location-names-to-select-a-location-then-display-it/
Your example will use variable URL parameters, not variable term archive URLs. If there are multiple filters, it's going to require a significant amount of custom code.
what is an advantage of using WordPress Archive over standard view
WordPress sets up archives automatically at specific URLs, so Toolset's WordPress Archives may be faster to implement because some of the system is automated. For example, you can use one WordPress Archive to display archives for each term in a taxonomy, without manipulating the Query Filters for the WordPress Archive.
yoursite.com/taxonomy-slug/term-slug
yoursite.com/taxonomy-slug/term-slug-2
yoursite.com/taxonomy-slug/term-slug-3
This pattern is common among WordPress sites, and the feed systems are set up to make these feeds available. If you wanted to accomplish this with Views, you would have to create custom Pages for each term, and then set up some way to manipulate the View's term query filter on each page, like a shortcode attribute or something, and they wouldn't be automatically available in archive feeds.
Thank you guys, I will use these hints to figure something out.