I'm working on an XML template for a site and need to output a series of listings where URLs look like:


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:nested name="collection_{collection_entry_id}" parse_tags="yes"}
                {stash:collection_cat}{exp:cat2:url_title category_id='{cat}'}{/stash:collection_cat}



{exp:stash:get_list name="collections"}

    {exp:stash:get_list:nested name="collection_{collection_entry_id}"}


Anyone see where I'm going wrong?

  • Have you tried append_list? e.g. {exp:stash:append_list:nested name="collection_{collection_entry_id}" parse_tags="yes"}
    – Natetronn
    Commented Apr 23, 2014 at 2:35
  • Oh shouldn't {collection_entry_id} in {exp:stash:set_list:nested name="collection_{collection_entry_id}" parse_tags="yes"} actually be just {entry_id} i.e collection_{entry_id}
    – Natetronn
    Commented Apr 23, 2014 at 2:41

1 Answer 1


You need to use the context parameter and a unique identifier in your nested list. Generally using entry_id is the easiest way to create a relationship between your two lists.

  1. Stash {entry_id} in your outer list (used for retrieval wit get_list)
  2. Set the context parameter in your nested list and feed it {entry_id} from your outer list
  3. when getting your nested list, use the context parameter again and feed it the stashed {stash_entry_id} from step one.

Here is a detailed explanation and example on the Stash wiki.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.