Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I am trying to expand some code suppled by Mark Croxton in another thread to create a list of Matrix results from a related entry but without success. This is with Stash 2.3.5 on ExpressionEngine 2.5.3.

Here is my SET code from my main template:

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

      {exp:channel:entries channel="slideshow" sort="date" dynamic="no" disable="member_data|pagination" parse="inward"}

        {stash:stash_entry_id}{entry_id}{/stash:stash_entry_id}
        {stash:title}{title}{/stash:title}
        {stash:landing_slideshow_image}{landing_page_slideshow_image}{/stash:landing_slideshow_image}

        {exp:stash:set_list:nested name="lb_slideshow_credits_{entry_id}" parse_tags="yes"}
          {related_entries id="related_work_project"}
            {work_team}
              {stash:lp_slideshow_position}{mx_position}{/stash:lp_slideshow_position}
              {stash:lp_slideshow_person}{mx_person}{/stash:lp_slideshow_person}
            {/work_team}
          {/related_entries}
        {/exp:stash:set_list:nested}

      {/exp:channel:entries}

    {/exp:stash:set_list}

And here is the GET code I have in an embeded template:

  {exp:stash:get_list name="landing_slideshow"}
    <ul class="normal">
      <li>{stash_entry_id}</li>
      {exp:stash:get_list:nested name="lb_slideshow_credits_{entry_id}"}
        <li><span class="">{lp_slideshow_position} | </span> {lp_slideshow_person}</li>
      {/exp:stash:get_list:nested}
    </ul>
  {/exp:stash:get_list}

The Stashed values set outside the {related_entries} loop — {stash_entry_id}, {title} and {landing_slideshow_image} are all displaying as expected. Nothing in the {related_entries} loop is displaying or appears to be stashed.

Does using related entries change things enough that answers in the other thread aren't applicable?

share|improve this question
1  
Are you using the latest Matrix? There was a bug in an older version that prevented it being captured by Stash. That aside, it looks like you actually need 3 levels of nested lists, since there may be multiple related entries and multiple matrix rows per related entry. –  Mark Croxton Dec 21 '12 at 23:49
1  
Well, there will be 8-10 entires in the slideshow channel, but each entry will have one related entry and, yes, the Matrix field will have multiple rows. Where would the third set_list go? I tried placing it just inside {work_team} — so a new set_list for each Matrix field — but that seemed to break all Stash parsing. I just upgraded from Matrix 2.5.1 to 2.5.2. –  Brooks Seymore Dec 22 '12 at 0:34
add comment

1 Answer 1

I solved this by removing Stash from the equation and instead using two {exp:channel:entries} tag. After 53 views of this question, my assumption is this is not a common use for Stash and thus the tradeoff between performance and supporting my own code 6 months down the line is low.

share|improve this answer
    
Can you make sure to select your answer as the correct one by clicking on the checkmark to the left. –  Anna_MediaGirl Jan 10 '13 at 4:56
    
I woud @AnnaBrown_MediaGirl, but I'm not sure if that is a correct answer — I didn't have time to mess with it any longer — but it was more tossing my hands in the air and giving up. Would be nice to know if this were actually possible but that's academic for me. –  Brooks Seymore Jan 10 '13 at 5:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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