Forums Forums Search & Filter Pro Dynamic Results URL

  • This topic has 5 replies, 3 voices, and was last updated 8 years ago by Ross.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #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
    #71887

    If 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
    #71917

    Hello 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.

    Trevor
    #71921

    Well, the search might not work is the main issue that I can think of. It may well work in Ajax mode though.

    Anonymous
    #71923

    Will let you know if i need any help regarding this thread.

    Thanks

    Ross Moderator
    #71931

    Hey 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 and sf_ajax_form_url filter as well the results_url (I think these would all be set to the same URL in this case).

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)