私はStashを初めて使っており、Matrixフィールドからデータを取得しようとしています。フィールドには画像とビデオの2つの列があり、複数の行列行があります。
私はStashのドキュメントの例を使用しましたが、それはまだ私のために働いていません。私は行列以外のデータをうまく取得していますが、Matrix項目は取得していません。誰も私が行方不明にスポットすることはできますか?
ありがとう。
{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'}">
{item_video}
{item_image}
</div>
{/exp:stash:get_list:nested}
<div class="row">
<div class="description col-xs-12">
{item_date}
{item_title}
{item_copy}
Read more
</div><!-- /description-->
</div><!-- /row-->
</div><!-- /row blog-post-item-->
{/exp:stash:get_list}