I need to pass a list of the first level of categories to a nested switchee. The following works when I manually place the nested list. However I would like the client to be able to add/edit categories.
{exp:switchee variable="{segment_2}" parse="inward"}
{case value="#^P(/d+)$#|category|''"}
{switchee variable="{segment_3}" parse="inward"}
{case value="walls|seating|workstation|training|private-offices|ergo|meeting-media-room"}{!--level 1 category listing--}
first level category listing here
{/case}{!--level 1 category listing--}
{case default="yes"}{!--level 2 category listing--}
2nd level category listing here
{/case}{!--level 2 category listing--}
{/switchee}{!--end nested switchee--}
{/case}{!--listing & category listing--}
{case value="value" default="yes"}
single entry here
{/case}{!--single--}
{/exp:switchee}
When I replace the case value list with the code below it doesn't work. I'm sure it's something to do with parse order, but am stuck. If I place the code below elsewhere in the template it outputs what I need.
{exp:gwcode_categories channel="products" depth="1" style="linear" backspace="1"}{cat_name}|{/exp:gwcode_categories}
Possibly this could be done with Stash, but I've never been able to grok how to use stash.