0

I know we can output 'keywords' as search parameters on the search result page. But we perform only search in custom fields (by means of checkboxes on search page) and I wonder how to output even those values on the result page to help the visitors. Many thanks for looking at this.

EDIT

2015/02/17

Thanks to the help from Low I finally got it. (Why not earlier, my search was in checkboxes (channel 'work' field 'material') based on values in channel 'material' field 'material_content'. In my search result I mixed the two up. Hence no results showed. The same form searched also in two categories, that I got working after reading again the manual and Low's answer.

Working code:

    {exp:low_search:results
  query="{segment_2}"
  status="not closed"
  disable="member_data|category_fields"
  require_all="material"
}
{if count == 1}
    <p>
      Resultat för <strong>{material}</strong> och <strong>{exp:channel:categories show="{low_search_category}" style="linear"}
   {category_name}
{/exp:channel:categories}</strong>


      Antal resultat: <strong>{absolute_results}</strong>
    </p>
  {/if}

{/exp:low_search:results}

My thanks is big, very big.

0

As per these rules, any Low Search parameter value can be displayed in your templates by using the {low_search_param_name} syntax. For multi-valued parameters, this will result in a pipe-separated list of values. You could use Low List to iterate through each of those values, or you could use the variable as input for another tag to achieve the same.

For example, if you're using checkboxes to filter results by category, then the parameter value will be a pipe-separated list of category IDs:

{low_search_category} => 1|2|3

You can then use that var as input for the channel:categories tag, thusly:

{exp:channel:categories show="{low_search_category}" style="linear"}
    ...
{/exp:channel:categories}

Note that this requires the tag to be inside the Form, Filters or Results tag, so the {low_search_param_name} can be resolved.

Similarly, you can use the Param tag to output a parameter value outside of the Form, Filters or Results tag.

| improve this answer | |
  • Hi LowExcuse my complete lack of understanding, but I do not understand the manual. – Hansl Feb 17 '16 at 19:52
  • In that case, please elaborate and explain exactly what it is you're after, and I'll be able to provide you with a more specific answer. – Low Feb 17 '16 at 19:59
  • I can search, I do get (the correct) results. But I can not show my users what parameters they have used. We searched inside field material_content in channel material. {exp:low_search:results query="{segment_2}" status="not closed" disable="member_data|category_fields" require_all="material" } {low_search_search:material_content} {/exp:low_search:results} The above code does not work (even tried {low_search_material_content}) – Hansl Feb 17 '16 at 20:00
  • Please edit your original question and add the code examples there. The comment section here isn't suitable for this. – Low Feb 17 '16 at 20:02
  • I understand. I edited my question and accepted your answer. Thank you very much for the assistance. – Hansl Feb 18 '16 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.