Forums Forums Search & Filter Pro Set parameter via shortcode? eg [searchandfilter id="7" show="results" q="term"]

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #196136

    Hello,

    I am wanting to tidy up the search url structure for some pages that perform a limited range of searches.

    I want the search parameter to be determined by the url, read and processed in php then passed to the searchandfilter shortcode as a query.

    for example: http://example.com/page/<dynamic_search_term>/

    The search and filter results are called via a shortcode as follows:

    <?php echo do_shortcode(‘[searchandfilter id=”2573″ show=”results”]’); ?>

    How can one inject the query parameters into the shortcode? e.g.

    [searchandfilter id=”2573″ show=”results” query=”abcd”]

    Have not been able to find this in the documentation.

    Thanks for your help.
    Don

    Trevor
    #196155

    I am afraid that what you want to do is not currently possible via a shortcode. Our plugin uses javascript to read the search parameters from the URL and then processes that. I am not sure how V3 of our plugin will do this, but it will be different.

    Anonymous
    #196305

    Hi Trevor,

    OK, so maybe I need to intercept the search query parameter on the server side prior to the search?
    That way, the javascript could read one thing in the url, send the request to the server, which (re-)interprets/rewrites the search parameter prior to the query being submitted.

    Would this work? How would I do this?

    Thank you,
    Don

    Trevor
    #196351

    Modifications to the query can be made using the Edit Query Arguments filter.

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