1

Here's the code i'm essentially trying to achieve

{exp:stash:set="page_content"}
    {exp:channel:entries channel="photos" dynamaic="off" entry_id="{structure:child_ids_for:1}"}
        {!-- My Code --}
    {/exp:channel:entries}
{/exp:stash:set}

This is my first problem {structure:child_ids_for:1} is unable to output as a channel parmater. I tried to stash that structure variable, I tried it as a snippet and no luck with both. I'm also using template partials so that's why page_content is being set.

This following code works with static values but not the {structure:child_ids_for:1} tag in the stash set.

Works:        {exp:stash:set name="photo_child_ids"}2|3|4{/exp:stash:set}
Doesn't Work: {exp:stash:set name="photo_child_ids"}{structure:child_ids_for:1}{/exp:stash:set}

Template Code

{exp:stash:set="page_content"}
    {exp:stash:parse process="end"}
        {exp:channel:entries channel="photos" parse="inward" dynamaic="off" entry_id="{stash:photo_child_ids}"}
            {!-- EE Code --}
        {/exp:channel:entries}
    {/exp:stash:parse}
{/exp:stash:set}

Any Ideas?


EDIT: Thanks for the answers. The solution is below.

This stashes the structure child ID tag

{exp:stash:set name="photo_child_ids" process="end" parse_tags="yes"}{structure:child_ids_for:1}{/exp:stash:set}

This code gets that photo_child_ids stash variable and sets it as a parameter

{exp:stash:set name="page_content"}
    {exp:stash:parse process="end"}
        {exp:channel:entries channel="photos" parse="inward" dynamic="off" entry_id="{stash:photo_child_ids}"}
            {!-- My Code --}
        {/exp:channel:entries}
    {/exp:stash:parse}
{/exp:stash:set}
1

First, dynamic is misspelled.

Second, Try to add parse_tags="yes" to the stash set.

{exp:stash:set="page_content" parse_tags="yes"}
    {exp:channel:entries channel="photos" dynamic="off" entry_id="{structure:child_ids_for:1}" parse="inward"}
         {!-- My Code --}
    {/exp:channel:entries}
{/exp:stash:set}

The parse_tags="yes" tells stash to parse whatever tags are inside rather than simply stashing the code as text.

| improve this answer | |
0

Put the channel entry tags within an embedded template and pass the structure value as embed parameter as

{exp:stash:set="page_content"}
{embed="temp_grp/temp_name" entry_ids="{structure:child_ids_for:1}"}
{/exp:stash:set}

within "temp_grp/temp_name"

{exp:channel:entries channel="photos" dynamic="no" entry_id="{embed:entry_ids}" parse="inward"}
{!-- My Code --}
{/exp:channel:entries}

I hope, it would help you.

| improve this answer | |
  • Yea I knew about the embed route. I was trying to avoid using them as much as possible. Stash has been great where it eliminates the need to do that in most cases. – Dan Mar 21 '13 at 13:00

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.