0

I'm trying to display a nested nested list of relationship entries using stash. The following standard EE template code correctly displays all of the data.

{!-- Category page --}
{exp:channel:entries channel="category_page" entry_id="16609" dynamic="no"}

    {!-- Category page title --}
    {title}

    {!-- Get parent Landing page content --}
    {parents field="cf_landing_categories"}

        {!-- Parent Landing page Feature 1 Places title --}
        {parents:cf_landing_feature1_title}

        {!-- Parent Landing page Feature 1 Places --}
        {parents:cf_landing_feature1_places}
            {parents:cf_landing_feature1_places:title}
        {/parents:cf_landing_feature1_places}

    {/parents}

{/exp:channel:entries}

However, if I then try to put this into Stash nested code as follows, only the {feature_list1_title} displays;

{!-- SET LIST --}

{exp:stash:set_list name="category-{segment_2}" parse_tags="yes" parse_conditionals="yes" parse_depth="3" save="yes" refresh="60" scope="site" replace="yes"}

    {exp:channel:entries
        channel="category_page"
        disable="{global:channel_disable_basic}"
        status="open"
        limit="1"
        require_entry="yes"
    }

        {stash:category_entry_id}{entry_id}{/stash:category_entry_id}

        {exp:stash:set_list:nested name="landing-{segment_1}-feature-list1" parse_tags="yes" parse_depth="2"}

            {parents field="cf_landing_categories"}

                {!--Landing page places title--}
                {stash:feature_list1_title}{parents:cf_landing_feature1_title}{/stash:feature_list1_title}

                {!--Landing page places--}
                {exp:stash:set_list:places name="landing-{segment_1}-feature-list1-places" parse_tags="yes" parse_depth="2"}

                    {parents:cf_landing_feature1_places}

                        {stash:feature1_place_title}{parents:cf_landing_feature1_places:title}{/stash:feature1_place_title}

                    {/parents:cf_landing_feature1_places}

                {/exp:stash:set_list:places}

            {/parents}

        {/exp:stash:set_list:nested}

    {/exp:channel:entries}

{/exp:stash:set_list}

{!-- GET LIST --}

{exp:stash:get_list name="category-{segment_2}"}

    {exp:stash:get_list:nested name="landing-{segment_1}-feature-list1" context="{category_entry_id}" save="yes" scope="site"}

        {feature_list1_title}

            {exp:stash:get_list:places context="{category_entry_id}" name="landing-{segment_1}-feature-list1-places" orderby="random" limit="3"}

                {feature1_place_title}

            {/exp:stash:get_list:places}

    {/exp:stash:get_list:nested}

{/exp:stash:get_list}

1 Answer 1

0

Your get_lists are using context but your set_lists are not, so they won't match up (context is really just a prefix for the name).

3
  • Hey @James Smith, sorry for the late reply. I didn't receive a notification that someone had replied. I took off the context from the exp:stash:get_list:places as I don't think that was right anyway, but still don't get the nested relationship working. Or maybe it's that I'm not sure what the context needs to be for the exp:stash:set_list:places :/ Jul 19, 2016 at 21:48
  • did you also remove it from the outer get_list? Jul 21, 2016 at 11:48
  • I left this one in place as this one seems to be working fine as it is correctly getting the {feature_list1_title} inside of it. Jul 21, 2016 at 13:36

Your Answer

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

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