I'm new to Stash and I'm trying to get the data from a Matrix field. The field has two columns, image and video, and there can be more than one matrix row.
I've used the example from the Stash documentation but it's still not working for me. I am getting the non-matrix data fine but not the Matrix items. Can anyone spot what I'm missing?
Thanks.
{if segment_2_category_id}
{exp:stash:set_list name="news_list" parse_tags="yes" parse_depth="2"}
{exp:channel:entries channel="news" status="open|featured" orderby="date" sort="desc" limit="10" category="{segment_2_category_id}"}
{stash:item_title}{title}{/stash:item_title}
{stash:item_url}{url_title}{/stash:item_url}
{stash:item_date}{entry_date format="%F %d, %Y "}{/stash:item_date}
{stash:item_copy}{news_content}{/stash:item_copy}
{exp:stash:set_list:nested name="item_media" context="{entry_id}" parse_tags="yes"}
{news_videos_images}
{stash:item_image}{image}{/stash:item_image}
{stash:item_video}{video}{/stash:item_video}
{/news_videos_images}
{/exp:stash:set_list:nested}
{/exp:channel:entries}
{/exp:stash:set_list}
{if:else}
{exp:channel:entries channel="news" status="open|featured" orderby="date" sort="desc" limit="10"}
{title}
{/exp:channel:entries}
{/if}
{exp:stash:get_list name="news_list"}
<div class="row blog-post-item">
{exp:stash:get_list:nested name="item_media" context="{item_entry_id}" prefix="nested"}
<div class="{nested:switch='row|rowAlt'}">
<p>{item_video}</p>
<p>{item_image}</p>
</div>
{/exp:stash:get_list:nested}
<div class="row">
<div class="description col-xs-12">
<h2>
<span class="date">{item_date}</span>
{item_title}
</h2>
{item_copy}
<a class="blue" href="{item_url}" title="{item_title}">Read more</a>
</div><!-- /description-->
</div><!-- /row-->
</div><!-- /row blog-post-item-->
{/exp:stash:get_list}