All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Multiple results page with multiple dynamic query but single form

sajwal 6 Jan 2015 21:18 question, complete

Hi I am using non-encoded query strings ....

1. Is it possible to modify the query strings in hook and use for another results tag (for the same form submitted)

Example
URL QUERY STRING IS
www.domain.com/?city=sydney&country=a...

Results Tag 1 - Fetches all results from sydney | australia

Results Tag 2 - Discard the original query and use another results based on custom query like city=foo&country=bar&lat=hello

Replies

  1. cwcrawley 6 Jan 2015 21:54

    Before I fully answer this on Lows behalf - how are you anticipating getting the second query tags? Are they going to be manually specified?

    Regards,

    Carl

  2. sajwal 6 Jan 2015 22:02

    Thanks for helping...

    I want consider some query information for second query tags and discard the non required...

    .... i think i am quite close ... can u put more lights on it?

  3. Low 6 Jan 2015 22:35

    Using GET vars means all Results tags will always look at the query string to filter entries. If you want different results on the second tag, you'll have to hard-code the parameters. Any other parameters present in the query but not on the tag, will still be applied to the Results tag.

    To overcome this, you can use encoded queries, with the query="" parameter, which you then don't add to the second tag. Then that tag will only filter entries based on the parameters set.

    If you don't want to use encoded queries, you could create an extension using the low_search_pre_search hook to optionally empty out the query string parameters.

  4. sajwal 6 Jan 2015 23:03

    Thanks a lot Low ...

    I understood the points u said... 2 more questions

    Question 1.

    Astonishingly i get correct results for hard-coded parameters used in 2nd tag but only when i write manually : (If i use enclosers ... or plugin out put they dont work)


    Example :

    {exp:low_search:results
    limit="5"
    collection="foo"
    status="not closed"
    parse="inward"
    keywords=""
    search:area="Melbourne" ///-------------> Gives results
    }

    But

    {exp:low_search:results
    limit="5"
    collection="foo"
    status="not closed"
    parse="inward"
    keywords=""
    search:area="{plugin:output} OR {preload variable}" ///-------------> Gives no results
    }


    I believe its just some parsing issue.....


    Question 2.
    In low_search_pre_search hook ... how would i determine that the hook is not executed for the first results tag and only executes for the 2nd result tag??


    I think i understand the hook now has the ability to output all results params ...

    Low ...Can u please suggest some help on question 1. (Any reasons why it might be not accepting tagged data ... parse input is used though) ...

    Appreciating your help.

  5. sajwal 6 Jan 2015 23:38

    Well its all sorted using low_search_pre_search hook ... Thanks a lot mite....happy new year low....awaiting lots of addons.... :)

  6. Low 7 Jan 2015 07:26

    Q1: Yeah, that will be parse order. Turn on template debugging and look up the full Results opening tag. That will help you debug it.