Forums › Forums › Search & Filter Pro › Executing search from the results page
- This topic has 6 replies, 2 voices, and was last updated 3 years, 11 months ago by Anonymous.
-
Anonymous(Private) November 20, 2020 at 11:11 pm #267423
I have just started using the pro version of the plugin and am attempting to do the following:
– Insert a search form in the header
– Use as one of the parameters a meta-field (ACF field value)
– Execute a search based on the parameters in the form
I have gotten all of this to work where I am directing the result to use the theme’s search.php fileWhat I don’t seem to be able to do is
– Allow the user to execute a new search from the result (search.php) page which is a desired functionWhat happens is from the result page (search.php) the Search & Filter form is empty and so not visible – this is the case regardless whether I arrive at the search.php destination via Search & Filter or via a default WordPress search.
Any help would be appreciated
Trevor(Private) November 23, 2020 at 11:59 am #267496Are you able to send me a live link/URL to your search page so I can take a look?
If possible, can you direct me (with example searches I can make) to what I should do to replicate what you see, and what you need? If you would find it easier, a video with audio in English will work just fine (share the link for the video with me here).
Anonymous(Private) December 2, 2020 at 9:08 pm #268560Sorry for the delay … holiday here in the States…
Here is where I am using the drop-down form: https://wpstage.amazingribs.com/
Everything is working as I want it to and I wonder if I could take things further in two areas:1) in my drop-down there are two radio button parameters one for a meta value and another for a taxonomy -they are really mutually exclusive meaning that if a taxonomy term is selected content comes from one post type and if the meta value is selected the content comes from another post type … could I hide one group of radio buttons if a selection is made from the other group?
2) is there a way that I could specify a different results template (I am now using search.php) depending on which filter button is selected?
By the way I have been using facetWP for several years and this is my first venture using Search and Filter and I am quite impressed … thank you for developing this plugin
Trevor(Private) December 3, 2020 at 2:53 pm #2686791. This will become possible, I think, In V3, due ion a few months, but you would have to write some complex custom JavaScript to do that for now.
2. You are using the ‘As an Archive’ display results method, so you would have to do some coding in the child theme
search.php
file to decide which PHP to use for the results by testing the key filter value, which you could fetch using PHP, but again, that would be quite complex, but possible. This thread discusses how to fetch the filters set (or, at least, how to start to work out what they are):https://support.searchandfilter.com/forums/topic/acf-post-meta-fields-in-current_query-result/
-
AuthorPosts