I want to display multiple lists of entries on the same page, but with entries that have the same custom filed grouped together. I'm not able to use categories to do this and wondered if it would be possible to use Stash to achieve the desired results. This is along the lines of what I'm trying to achieve:

{exp:channel:entries channel='tour' disable="category_fields|member_data" show_future_entries="yes" orderby="tour_date_start" sort="asc" search:tour_type="tour"}
                    <div class="unit3">
                        <a href="{url_title_path='tours/'}">
                        <div class="unit1 unitpadding grey overview">
                                <li><a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} &ndash; {tour_date_end format="%j %F %Y"}</a>
                                <!--alternative tour dates to be outputted here if entries have the same {tour_code_short}->                                    
                                <li><a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} &ndash; {tour_date_end format="%j %F %Y"}</a>{/alternative_tour_dates}
                                <!-- end alternative tour dates -->

I feel like this might work with stash, but am not sure the best way to approach it? Could anyone offer any advice or guidance? Thanks.

2 Answers 2


You can use the match and against parameters to filter a list by the value of one or more columns.

{!-- set the list --}
{exp:stash:set_list name="groceries"}

   {stash:title}Cox Apple{/stash:title}

   {stash:title}Jazz Apple{/stash:title}





{!-- get all yellow groceries --}
{exp:stash:get_list name="groceries" match="#^yellow$#" against="color"}

This page in the wiki has a more advanced example of the technique, uisng a custom index to match against multiple columns:


  • Hi Mark thanks again for you help. I can see that this should work, and have implemented it as suggested, the problem I have is that the data that I'm trying to pull in ie the color that I want to sort by is dynamic. So I can't predict what the options will be to sort from? Is it possible to match against a field, say {stash:color}{color}{/stash:color} and then in the get_list match="#^{color}$#" ?
    – Erbert
    Commented Aug 12, 2014 at 14:06

You could try the 'Group By' extension, this effectively adds a SQL style 'GROUP BY' parameter to the channel entries tag - https://github.com/nathanpitman/group_by.ext.ee_addon

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.