0

Wondering if this is a bug or a parse order issue (probably parse_order).

Code is below, but basically i am trying to work with template partials approach and showing related videos for an article entry. The related videos field is a relationship and it can accept multiple.

In the main article template i store all related videos in a list. Then embed a partial below to display the videos.

The using stash:get_list in the embed to loop through the videos.

The issue i am seeing is that in the main template the list has 1 item, but once in the embed, the list has 5 items, 4 of which are blank records.

Working on Stash 2.6.0 and EE 2.9.2

---Main template article/view.html

{!-- Channel Entries --}
{exp:channel:entries channel="article" url_title="{segment_2}" limit="1"}

{!-- RELATED VIDEOS --}
{article_videos status="open|Featured"}
   {exp:stash:append_list name="videos" trim="yes" parse_tags="yes"}
      {stash:video_entry_id}{article_videos:entry_id}{/stash:video_entry_id}
   {/exp:stash:append_list}
{/article_videos}


{!-- DEBUG, OUTPUT = 1 --}
{exp:stash:get_list name="videos" prefix="related_videos"}
   {related_videos:total_results}
{/exp:stash:get_list}

{stash:embed:partials:videos}

{/exp:channel:entries}

---Embedded stash partial stash_embeds/partials/videos.html

{!-- DEBUG, OUTPUT = 5 --}
{exp:stash:get_list name="videos" prefix="related_videos"}
   {related_videos:total_results}
{/exp:stash:get_list}

Odd indeed, but it is messing up our conditionals and showing a bunch of blank images and cells.

Thanks, in advance

0

This is odd indeed! Have you tried moving the partial outside of the exp:channel:entries loop? In case its a parsing bug and the stash:embed:partials:videos tag is getting replaced multiple times or there's a parse order thing within stash?

Also, have you tried a straight forward {embed=""} on the videos partial, instead of the stash method?

Either of these methods may yeild clues if not a work around. Let us know how you get on!

| improve this answer | |
  • Actually. I answered my own question but for some reason it didn't save here. The issue was with the name of the list "videos" was probably reserved by another channel or stash var. changed the name to "related_videos" and all is well. Thanks for he followup – chrisgnycgo May 22 '15 at 12:09
  • Ahh great, but please do go ahead and try "Answering your Own Question" again (the button should be red to the left underneath this post) , so you can mark the answer and help others using the forum. Bear in mind there is a 2 day delay before you can accept your own answer but we'd all appriciate it if you could come back and do this, it really does help maintain these boards! – Blatant May 22 '15 at 12:52

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.