1

I have a problem with a Stash embedded template being called when it's inside a switch statement (or a conditional, already tried that too) which should evaluate as false.

For example:

{exp:switchee variable="{stash:_nav_active}" parse="inward"}

    {case value="home|404"}{/case}

    {case default="Yes"}

        {stash:embed
            name="partials:nav:{segment_1}"
            process="start"
        }

    {/case}

{/exp:switchee}

even when stash:_nav_active equals 404, the embed is being called and because the segment doesn't exist, I get:

Stash: the file "/stash_templates/partials/nav/made-up-segment.html" was not found.

2

I think since your stash embed is set to process on 'start' it will be run first before switchee, which is why you'd see a 'file not found' error if there's no stash file at that location. Try changing your embed to process="inline" and see if you still get the same error.

| improve this answer | |
0

Pretty sure I recall that if you're evaluating a stash variable you can remove the square brackets.

variable="stash:my_var" parse="inward"
| improve this answer | |
  • Gave that a go, but got the same result. – Tyssen Jan 28 '15 at 8:30

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.