I am trying to: I have a parametric search for CPTs but I want to be able to force on value and hide the field ( I am sure I can do this easy with CSS ).
So I have created separate pages for each state within Australia i.e. New South Wales, Victoria etc. and each page has a parametric search which works perfectly. The trick is to be able to a field set to a particular state and to exclude all values returned that are not in that state.
I can set a default value for that field but it only updates the search results ( and successfully omits all other states ) when I change the value to a different state. Is there someway that I can force this to happen without the need for the value to be set in the form?
Plan B: I can filter the results with a conditional statement in the Loop Output just after the <wpv-loop>:
[wpv-conditional if="( $(wpcf-state) eq 'Western Australia' )"]
This works but I am concerned how this would effect the efficiency of the query. The parametric search would effectuively be getting all results from across Australia and only the Loop Output will be refining it down to the relevant state.
I hope that all makes sense.
Many thanks,
Chris
I apologise, I do not understand correctly.
Are you trying to create a Parametric Search that shows the User only options (for the parameters) present in the Posts returned by a previous search?
It can be done in the GUI Settings for your Parametric Search Filters and also in the Parametric Search Settings > Let me choose individual settings manually > Which options to display in the form inputs
If you want to pass a Hidden Filter, you do not need the Parametric Search but could use the Query Filer instead.
Or, you can hide the Filter (Parametric Search) by passing [wpv-filter-start hide="true"] in the Filter section.
This is related Documetnation:
https://toolset.com/documentation/user-guides/front-page-filters/
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
Thanks for the reply Beda. I have taken another approach here that may work but I have another issue. I will create another thread to keep it clean.
Thanks,
Chris