I have a list and nested stash list loading and displaying ok until I try to cache. Once cached they both display fine on first load, but upon reload the nested list disappears.
I'm not clear on how to cache and reload a nested list, could someone please provide an example or modify the code below?
Thanks!
Not Working (Caching)
{!-- Stash list of homes and communities (in nested list) they belong to. Communities are stored in a playa relation within a matrix field. --}
{exp:stash:set_list
name="home_results_{segment_2}"
parse_tags="yes"
parse_depth="2"
parse_conditionals="yes"
save="yes"
refresh="1"
scope="site"
replace="no"
}
{exp:channel:entries
channel="homes"
dynamic="no"
category="1"
disable="member_data|pagination"
}
{stash:entry_id}{entry_id}{/stash:entry_id}
{stash:entry_title}{title}{/stash:entry_title}
{!-- Nested stuff. Stash the communties that this house is in. --}
{exp:stash:set_list:nested
name="related_entries_{entry_id}"
parse_tags="yes"
save="yes"
refresh="1"
scope="site"
replace="no"
}
{elevations} {!-- Matrix field --}
{stash:incommunity}
{elevation_community}{title} - {city_province}{/elevation_community} {!-- Playa field --}
{/stash:incommunity}
{/elevations}
{/exp:stash:set_list:nested}
{/exp:channel:entries}
{/exp:stash:set_list}
{!-- End of Home results stash. --}
{!-- Load the nested stash list with communities into content --}
{exp:stash:append name="content"}
{exp:stash:get_list name="home_results_{segment_2}"}
<div>
<strong>{entry_title}</strong><br>
{!-- Stash get the list of communities the home is built in --}
{exp:stash:get_list:nested unique="yes" prefix="nested" name="related_entries_{entry_id}"}
- {incommunity}<br>
{/exp:stash:get_list:nested}
</div>
{/exp:stash:get_list}
{/exp:stash:append}