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

Support archive

Search fields not included in generated query

Diego - Oltremedia s.a.s. 6 Apr 2018 14:24 question, complete

Hi,
I'm having an issue with Low Search.
With the following code, only child_cosa_incolla are used in the query generated.
For example, query generated with that code is
"child:cosa_incolla_relationship=cemento-massetto|mattoni&require_all=child:cosa_incolla_relationship". No way to use checkboxes ("specifiche").

Can you help me?

Thanks,

Diego

{exp:low_search:form query="{segment_3}" result_page="trova-prodotto/risultati"}

--
{exp:channel:entries channel="materiali_incollaggio" dynamic="no"}

{title}

{/exp:channel:entries}

--
{exp:channel:entries channel="materiali_incollaggio" dynamic="no"}

{title}

{/exp:channel:entries}

{exp:low_options:specifiche}
{options}

{option:value}

{/options}
{/exp:low_options:specifiche}

Go

{/exp:low_search:form}

Thanks,

Diego

Replies

  1. Low 6 Apr 2018 14:45

    I'm afraid GetSat strips away most HTML, so try again. You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.

  2. Diego - Oltremedia s.a.s. 6 Apr 2018 14:50

    Oh, damn. I'm really sorry.
    https://pastebin.com/tfWaUstu
    It's ok now.
    Thanks.

  3. Low 6 Apr 2018 15:01

    The value="" parameter of that other checkbox is empty, so therefore it won't be part of the query. You need to fill it with the appropriate value.

    Also, the conditional you're using is

    {if title == low_search_children:cosa_incolla_relationship}


    ...wich will not work for several reasons. Try this instead:

    {if low_search_child:cosa_incolla_relationship ~ '/\b'.url_title.'\b/'}

  4. Diego - Oltremedia s.a.s. 6 Apr 2018 15:46

    It's working now, thanks!
    How can I require *all* flagged checkboxes?
    https://pastebin.com/UmC8aA19 seems working, is that enough?
    The behaviour I want is that if I flag three checkboxes, two of them flagged in the backend/edit entry and one not, Low Search must not return me that entry.
    Thanks for your help!

  5. Low 7 Apr 2018 07:02

    yes, that input field would work. You can also hard-code that parameter on the Results tag, eg. require_all="search:specifiche"

    Add multiple parameter names in a pipe-separated list, eg: require_all="search:specifiche|child:cosa_incolla_relationship"

  6. Diego - Oltremedia s.a.s. 9 Apr 2018 08:01

    Thanks, it's working :)
    Bye, have a good day.