BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
Help getting selective display of child categories
#92 opened by JCOGS Design
Description
I am trying to get a category list to expand to show just the children of the currently active category.
Something like (if Cat 3 currently the active category)
-> Cat 1 -> Cat 2 -> Cat 3 (active) ---> Cat 3.1 ---> Cat 3.2 -> Cat 4 -> Cat 5
I can get this to happen using {construct.children}
that shows all the sub-categories of all the top level categories, but cannot work out how to add a filter to only show the entries for the currently active category.
Grateful for any guidance you can offer about (a) whether this can be done and (b) if so, some clues as to how...
Thanks!
Replies
- JCOGS Design
Replied 2/28/2018 12:36 PM, Edited 3/3/2018 1:57 PM
Grr... forgot the markdown for the example and can't seem to edit entry... so trying again...
-> Cat 2 -> Cat 3 (active) —-> Cat 3.1 —-> Cat 3.2 -> Cat 4 -> Cat 5```
- JCOGS Design
Replied 2/28/2018 12:37 PM, Edited 3/3/2018 1:57 PM
OK - markdown fail sorry. Hopefully you can work out the general idea anyhow.
- JCOGS Design
Replied 2/28/2018 12:44 PM, Edited 3/3/2018 1:57 PM
OK - found a way using Low seg2cat ... vis
{if if construct:cat_level == 2 && segment_2_category_id == construct:parent_id}
phew!
- TJ Draper
Replied 3/3/2018 1:57 PM
Glad you found a way to do it. I wasn't quite following your first couple of demos. But if what you have is working, then we'll go with it! :)