2

I want to pass the "series_entry_id" created in the exp:playa:parents tag as the parent_id of the exp:playa:siblings tag, but it is not parsing the "series_entry_id". I am not sure if there is a better, more efficient way of doing this. Any help is greatly appreciated.

{exp:stash:set_list
    name="sermon"
    parse_tags="yes"
    parse_depth="2"
    parse_conditionals="yes"
}

    {exp:channel:entries
        channel="media"
        dynamic="no"
        disable="categories|category_fields|member_data"
        orderby="date"
        url_title="{segment_3}"
        limit="1"
    }

        {stash:entry_id}{entry_id}{/stash:entry_id}
        {stash:title}{title}{/stash:title}
        {stash:url_title}{url_title}{/stash:url_title}
        {stash:speaker}{speaker}{/stash:speaker}
        {stash:description}{description}{/stash:description}
        {stash:vimeo_id}{vimeo_id}{/stash:vimeo_id}
        {stash:message_number}{message_number}{/stash:message_number}
        {stash:transcript_file}{transcript_file}{/stash:transcript_file}
        {stash:transcript_embed}{transcript_embed}{/stash:transcript_embed}
        {stash:entry_date}{entry_date}{/stash:entry_date}

        {!-- Get Series Data --}
        {exp:playa:parents channel="sermon_series" limit="1"}
            {stash:series_entry_id}{entry_id}{/stash:series_entry_id}
            {stash:series_title}{title}{/stash:series_title}
            {stash:series_url_title}{url_title}{/stash:series_url_title}
            {stash:series_graphic}{series_graphic}{/stash:series_graphic}
        {/exp:playa:parents}

        {!-- Get Series Siblings --}
        {exp:stash:set_list:nested
            name="siblings"
            parse_tags="yes"
        }

            {exp:playa:siblings entry_id="{entry_id}" parent_id="{series_entry_id}"}
                {stash:sibling_url_title}{url_title}{/stash:sibling_url_title}
                {stash:sibling_title}{title}{/stash:sibling_title}
                {stash:sibling_entry_date}{entry_date}{/stash:sibling_entry_date}
            {/exp:playa:siblings}

        {/exp:stash:set_list:nested}

    {/exp:channel:entries}

{/exp:stash:set_list}

2 Answers 2

2

The series_entry_id variable is not defined at the point you're calling it. Try simplifying by avoiding the nesting. The siblings tag doesn't need to be inside the channel entries tag since you have already stashed the entry_id and can use that outside the loop. (Alternatively you might be able to get a quick win with a few well-placed parse="inward" parameters, but personally I find them to be too black-magicky). Something like this perhaps:

{exp:stash:set_list
 name="sermon"
 parse_tags="yes"
 parse_depth="2"
 parse_conditionals="yes"
}
  {exp:channel:entries
    channel="media"
    dynamic="no"
    disable="categories|category_fields|member_data"
    orderby="date"
    url_title="{segment_3}"
    limit="1"
  }
    {stash:entry_id}{entry_id}{/stash:entry_id}
    {stash:title}{title}{/stash:title}
    {stash:url_title}{url_title}{/stash:url_title}
    {stash:speaker}{speaker}{/stash:speaker}
    {stash:description}{description}{/stash:description}
    {stash:vimeo_id}{vimeo_id}{/stash:vimeo_id}
    {stash:message_number}{message_number}{/stash:message_number}
    {stash:transcript_file}{transcript_file}{/stash:transcript_file}
    {stash:transcript_embed}{transcript_embed}{/stash:transcript_embed}
    {stash:entry_date}{entry_date}{/stash:entry_date}

    {!-- Get Series Data --}
    {exp:playa:parents channel="sermon_series" limit="1"}
        {stash:series_entry_id}{entry_id}{/stash:series_entry_id}
        {stash:series_title}{title}{/stash:series_title}
        {stash:series_url_title}{url_title}{/stash:series_url_title}
        {stash:series_graphic}{series_graphic}{/stash:series_graphic}
    {/exp:playa:parents}

  {/exp:channel:entries}
{/exp:stash:set_list}

{exp:stash:get_list name="sermon"}
    {!-- Get Series Siblings --}
    {exp:stash:set_list
        name="siblings"
        parse_tags="yes"
    }
        {exp:playa:siblings entry_id="{entry_id}" parent_id="{series_entry_id}"}
            {stash:sibling_url_title}{url_title}{/stash:sibling_url_title}
            {stash:sibling_title}{title}{/stash:sibling_title}
            {stash:sibling_entry_date}{entry_date}{/stash:sibling_entry_date}
        {/exp:playa:siblings}

    {/exp:stash:set_list}
{/exp:stash:get_list}
0

I'm not certain, but maybe try a higher parse_depth on your very first {stash:set_list} tag. Try parse_depth=3 or parse_depth=4 maybe?

{exp:stash:set_list
  name="sermon"
  parse_tags="yes"
  parse_depth="4"
  parse_conditionals="yes"
}

I find I typically have to bump up the parse_depth if I'm using a Playa tag in a channel:entries tag in Stash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.