0

I'm setting up a search using nested categories. So in category_grouy 5 I have 5 parent categories and a handful of nested child categories. Using the below returns all categories but parent searches return no results.

<select name="category[]" multiple="multiple">
    {exp:channel:categories channel="attraction" style="linear" category_group="5"}
        <option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
            {category_name}
        </option>
    {/exp:channel:categories}
</select>

Using this next section gives me the display I want but still the same problem. It's not returning any of the children.

<select name="category[]" multiple="multiple">
    {exp:channel:categories channel="attraction" parent_only="yes" style="linear" category_group="5"}
        <option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
            {category_name}
        </option>
    {/exp:channel:categories}
</select>

My question: I can display parent categories, so how do I get Low Search to return sub categories when the parent is searched?

1

Can you go to CP -> Admin -> Channel Administration -> Global Preferences.

See hear if "Auto-Assign Category Parents" is selected as "Yes".

I hope, it would work.

3
  • Bashkar is right. It's just like the native category parameter. If category A is the parent of category B, and only B is selected for an entry, EE thinks the entry is only assigned to B, not A. In other words, the category hierarchy is simply ignored. Using the "auto-assign category parents" option will automatically select all parent categories too (so you'll see them selected in the CP for that entry), and therefore the entry will be returned when looking for category A.
    – Low
    Jul 7 '13 at 8:24
  • Thanks Low!... I have used "Low Search" module so many times but never faced any issue. The doc of this module describes everything very nicely.... Jul 7 '13 at 17:35
  • I had it selected, but turns out I didn't have the categories assigned to parents when I initially ran the import. I reran the import and the parents were selected as well. Thanks!
    – brunam
    Jul 8 '13 at 14:32

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.