Not sure I understand fully but i'm assuming that you want to add this search bar to 12 different pages but have 12 different items preselected for that respective page ?
Please let me know if this is what you are referring to.
It can be done but it would be tricky to achieve. Essentially you can get the field to be preselected by using the URL parameter. hidden link
If you click the link above you will notice that the filter will be preselected to norfolk. Now if you're able to pass the URL parameter when you click to each of the pages then you can have the area preselected.
Meaning if you are Clicking to the Norfolk page, and want the view to have norfolk pre-selected then you will need to pass the URL parameter ?wpv-area=norfolk but on that button itself that clicks to norfolk the static parameter would be there.
This is the only way I see of doing it. For further clarification do you just want the filter to be preselected or is it that you want the view to actually be filtered with the results? Is there an example page ? We may be able to work around this using the hook below https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
Yes we use this method: hidden link
To pre -select buttons and links so when clicked they end up on the Search Results page with the area reastults already displayed.
However, I guess for this to work on a 'page' we would have to have the page URL set to ?wpv-area=norfolk
If this the case we can't really do that, it's not great looking or ideal for Google.
Is this what you are suggesting ref using the URL param? Setting the page YRL to ?wpv-area=norfolk
However, I guess for this to work on a 'page' we would have to have the page URL set to ?wpv-area=norfolk
If this the case we can't really do that, it's not great looking or ideal for Google.
That is correct if it to work on a page then it will need to be set in the URL parameter. Is this what you are suggesting ref using the URL param? Setting the page YRL to ?wpv-area=norfolk
What I was thinking was to have a custom php filter that will pre-filter the listings based on the page that the view is on. Generally each page will have a different ID so we can use the PHP filter to pre-filter the list. The only problem is that the dropdown won't have the prefiltered value select because the URL is what sets this. The filter is listening out for the particular url parameter.
So if you want to have the list pre filtered but not have the dropdown preselected then we can do this with the filter query hook.