Tell us what you are trying to do?
On an Archive page with Search, is there a way in the Archive Search to add a button to filter by a chosen taxonomy term? I can do this with a Custom Search Filter, but it shows all taxonomy terms. I just want a single button with one term. Can it be done?
Is there any documentation that you are following?
No
Is there a similar example that we can see?
No
What is the link to your site?
Staging site not online
Hi,
Thank you for contacting us and I'd be happy to assist.
There are a couple of ways you can approach this.
One option is to let all the terms show through the regular search filter, but include custom CSS or JS code to hide the ones that you don't want to show.
Another alternative can be to include the regular search filter and copy its HTML/markup from the inspect element tool in the browser, on the front end. Then you can include that HTML/markup in a 'Fields and Text' block in place of the search filter block, only keeping the desired term's HTML markup.
I hope this helps and please let me know if you need further assistance.
regards,
Waqar
Thanks for the ideas...
Option 1 -- not ideal, a bit bulky and does not allow both a button for a term and a select for any term.
Option 2 -- tried this (did not understand 'Fields and Text' block functionality previously). This is getting closer.
But...
The theory is fine -- I can put the HTML markup in but have to ALSO have the Custom Search Filter ABOVE it in the page structure in the set or it does not work. This is OK (I can have both), but two select boxes (either checkbox or radio button) with the same function means that the checkbox for the single taxonomy term does not stay checked -- it instead checks in the ABOVE CSF.
Not sure how to get round this...
Any more ideas?
Thanks for writing back.
For Option 2, you'll need some custom CSS code to hide the extra search filter and some JS code to detect which of the options is selected, once the search is performed.
If you could share the link to the archive page through an online staging website, I'll be able to share some more pointers.