Forums › Forums › Search & Filter Pro › Dynamic Results URL
Tagged: ajax, Dynamic, Dynamic Results URL, Results URL, shortcode, url
- This topic has 5 replies, 3 voices, and was last updated 8 years, 1 month ago by Ross.
-
Anonymous(Private) November 23, 2016 at 7:10 am #71859
Hello,
For my website, Search Form will be available on all the pages, Results should be displayed on the same page where the Search Form is located.
For this, I will place the Search Form Shortcode and the Results Shortcode: in header.php
I want to set current page as the Results URL . So that Result will display in all pages without changing the URL.
For this, Can I leave the Results URL: field empty?
Will this cause any misbehaviour?
Thanks.
Trevor(Private) November 23, 2016 at 11:01 am #71887If you want to have the results display on the same page as the form, you will need to use the
As an Archive
Display Results method, enable Ajax and make sure that the Results Container is correct. Depending on your theme, this should work. However, with some themes additional work to achieve your goal may be required.You cannot do as you wish with the Shortcode Method, as this requires a Results URL to be completed, but the Custom method may work if you know which template your theme uses and can edit it. However, this method relies on you theme template providing a wp loop to output the results, which I doubt that the header.php would do.
Anonymous(Private) November 23, 2016 at 12:13 pm #71917Hello Trevor,
Thanks for your prompt reply.
I’m using DIVI theme.
I placed the Search Form Shortcode and the Results Shortcode: in few pages and left the Results URL: field empty.
In Admin Dashboard its showing the below message, but in Site(frontend) its working fine as i wanted.
“Error: Your Results URL is empty – go to Display Results tab to fix”Just want to make sure whether leaving the Results URL: field empty will cause any issue in future or not?
Thanks.
Ross Moderator(Private) November 23, 2016 at 2:26 pm #71931Hey Jeykumar
There is one way (completely untested, but actually might just work) that you could modify the results url, using this filter –
https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Modify_URLs
If using the shortcode display method I think you would only need to use the
sf_results_url
filter.However if using any other display method I think you would need to use the
sf_ajax_results_url
andsf_ajax_form_url
filter as well the results_url (I think these would all be set to the same URL in this case).Thanks
-
AuthorPosts