I'm working on an XML template for a site and need to output a series of listings where URLs look like:
/store/#type#/#brand#/#collection#/
My entries are set up so that there's an entry for each brand with a matrix row for each collection (type is a category of the entry).
So I need to loop through the entries in the channel and then loop through the matrix rows for each entry and output a <url>
pair for all of them.
With the code below I get output if I don't have the exp:stash:get_list:nested
tag (but with incorrect URLs), but with it, I get nothing.
{exp:stash:set_list
name="collections"
parse_depth="2"
parse_tags="yes"
}
{exp:channel:entries
channel="brands"
disable="member_data|pagination|trackbacks"
dynamic="no"
}
{stash:collection_url_title}{url_title}{/stash:collection_url_title}
{stash:collection_entry_id}{entry_id}{/stash:collection_entry_id}
{stash:collection_type}{categories}{category_url_title}{/categories}{/stash:collection_type}
{exp:stash:set_list:nested name="collection_{collection_entry_id}" parse_tags="yes"}
{cat_images}
{stash:collection_cat}{exp:cat2:url_title category_id='{cat}'}{/stash:collection_cat}
{/cat_images}
{/exp:stash:set_list:nested}
{/exp:channel:entries}
{/exp:stash:set_list}
{exp:stash:get_list name="collections"}
{exp:stash:get_list:nested name="collection_{collection_entry_id}"}
<url>
<loc>http://www.domain.com.au/store/{collection_type}/{collection_url_title}/{collection_cat}/</loc>
</url>
{/exp:stash:get_list:nested}
{/exp:stash:get_list}
Anyone see where I'm going wrong?
{exp:stash:append_list:nested name="collection_{collection_entry_id}" parse_tags="yes"}
{collection_entry_id}
in{exp:stash:set_list:nested name="collection_{collection_entry_id}" parse_tags="yes"}
actually be just{entry_id}
i.ecollection_{entry_id}