I’m trying to embed categories into a Switchee value field but can’t get it to work. I’m concerned it might be a bug. Can you help?
To head off parse order problems, I call the Switchee embed from my site/index template:
{embed="site/.cases" categories="{exp:channel:categories category_group="1" style="linear" backspace=“1”}{category_url_title}|{/exp:channel:categories}"}
And this is the site/.cases template:
{exp:switchee variable="{segment_1}" parse="inward"}
{case value="{embed:categories}"} {embed="site/page" channel="page"} {/case}
{case default="yes"} {embed="site/404"} {/case}
{/exp:switchee}
It fails by going to the default case.
I tried embedding via Low Variables and Template Morsels both directly and through a similar embed method as above and they failed, too.
For example, if I embed a Low Variable into the case value like this…
{case value="{lv-categories}"} {embed="site/page" channel="page"} {/case}
...and then define the Low Variable as my categories…
about|sample-category|support|visit
...it works.
But if, in my Low Variable I replace it with what will generate the same thing…
{exp:channel:categories category_group="1" style="linear" backspace="1"}{category_url_title}|{/exp:channel:categories}
...it fails.
I’m at my wits end! Any tips?
|