I can’t seem to figure out how to do this correctly.
I’m using Content Elements as a field and stashing those values as you would typically do in a Stash list. However, when I call that list the sequence of what is being outputted seems to match the sequence in my code and not in the published entry.
Setting the list:
{exp:stash:set_list name="h" parse_tags="yes" parse_depth="2"}
{h}
{heading}
{stash:h_header}{value}{/stash:h_header}
{/heading}
{wygwam}
{stash:h_wygwam}{value}{/stash:h_wygwam}
{/wygwam}
{assets}
{files}
{stash:h_assets}{url}{/stash:h_assets}
{stash:h_assets_alt}{alt_text}{/stash:h_assets_alt}
{/files}
{/assets}
{/h}
{/exp:stash:set_list}
My template:
{if segment_1 == "about"}
<div class="row">
<div class="small-12 columns">
{exp:stash:get_list name="h"}
{count}
{if h_header != ""}{h_header}{/if}
{h_wygwam}
{if h_assets != ""}<img src="{h_assets}"alt="{h_assets_alt}">{/if}
{/exp:stash:get_list}
</div>
</div>
{/if}
Based on the above the {h_header} always gets listed first even though it might not actually be the first entry in the list. Hope this makes sense.
I have a feeling I’m not doing this correctly in Stash and not in Content Elements.
Thanks for the help.