Problem: I have a custom search View that contains two front-end filters. Based on which filters have been chosen, I would like to append different URL parameters to a link's href attribute.
Solution: You can use conditional HTML blocks and the wpv-search-term shortcode to test whether or not a filter's URL parameter exists, then output different link hrefs based on those URL parameter values.
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-search-term
https://toolset.com/forums/topic/if-wpv-post-param-has-a-specific-var-then/
https://toolset.com/forums/topic/conditional-url-parameters-and-parametric-search/
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 2 replies, has 2 voices.
Last updated by 4 years, 9 months ago.
Assisted by: Christian Cox.