Inside of my entries loop I have a Matrix field called {blog_images}
where the user can store up to 10 images. The user then determines where these images should appear in the content area ({blog_post_content}
) using shortcodes like this:
<p>First paragraph is here.</p>
{image_1}
<p>Second paragraph is here.</p>
{image_2}
<p>…</p>
Currently I'm using Stash to loop through the Matrix images and store them for insertion into {blog_post_content}
. Strange thing is if I have 10 entries appear on the page, every entry is showing only the image from the LAST entry instead of its own image.
Here is my existing code:
{blog_images}
{exp:stash:set type="snippet" parse_tags="yes" parse_conditionals="yes"}
{stash:image_{row_count}}
<figure class="{placement} {size}">
{exp:ce_img:pair src="{image}" width="{size}" allow_scale_larger="no" cache_dir="images/blog" hide_relative_path="yes" parse="inward"}
<img src="/assets/images/css/holder.png" width="{width}" height="{height}" data-src="{made}" alt="{alt_text}">
{/exp:ce_img:pair}
{if caption}
<figcaption>
{caption}
</figcaption>
{/if}
</figure>
{/stash:image_{row_count}}
{/exp:stash:set}
{/blog_images}
{exp:stash:parse process="end"}
{blog_post_content}
{/exp:stash:parse}
Any idea what I'm doing wrong?