I'm using Stash to capture a list of articles. I'm trying to keep my viewModel separate from my view markup.

For each article, I'm capturing a nested list of categories.

In the view, I want to output comma-separated categories. I was under the impression that I could use backspace="x" on a get_list, but it doesn't seem to work. I am I going about this incorrectly?

I suppose I could use an if/else with 'count' and 'total_results' to remove the final comma and space, but would also like to know if backspace can work.

Set article list

{!-- Articles --}
{exp:stash:set_list name="articles" parse_tags="yes" parse_depth="2"}

        {exp:stash:set_list:nested name="this_article_categories" parse_tags="yes" context="{entry_id}"}

Get Articles (See the get_list:nested name="this_article_categories" in the code below.)

{!-- Get Articles --}
{exp:stash:get_list name="articles" prefix="news" paginate="bottom" limit="15"}
        <div class="meta">
            {news:date format="%M %j, %Y"} in {exp:stash:get_list:nested name="this_article_categories" backspace="2" context="{news:id}"}
                <a href="/news-events/news/category/{category_url_title}">{category_name}</a>, 
        <h1 class="gamma"><a href="{news:url}">{news:title}</a></h1>
    <div class="article-body">
    <p class="read-more"><a href="{news:url}">Continue reading <i class="ss-gizmo ss-right"></i></a></p>


  • I also posted the question on devot-ee where @mark-croxton says that backspace should be available on get_list, but maybe I'm not reading that right. devot-ee.com/add-ons/support/stash/viewthread/10103
    – jthomas
    Jul 16, 2014 at 18:24
  • Just a question: How are you using context="{entry_id}" in the set_list and context="{news:id}" in the get_list? Jul 16, 2014 at 21:53
  • I believe it's because I name it {stash:id} instead of {stash:entry_id} in the setter. And I have a news prefix on my getter. But in the nested list in the setter, I use the default {entry_id} for the context.
    – jthomas
    Jul 16, 2014 at 22:53

1 Answer 1


The backspace parameter can be used with {exp:stash:get_list}, however be aware that any trailing whitespace and line breaks will count as 'spaces'.

{!-- Desired output - no trailing comma --}
Product 1, Products 2, Product 3

{!-- this won't work because of the line break after the comma --}
{exp:stash:get_list name="products" backspace="1"}

{!-- Either close the space up manually... --}
{exp:stash:get_list name="products" backspace="1"}{title},{/exp:stash:get_list}

{!-- ...or use the trim parameter --}
{exp:stash:get_list name="products" trim="y"}

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.