I have a list of items. Each item has a season. I am trying to organize the items by season. I believe the list is pre sorted and I need to create a header everytime there item has a new season
In php I would imagine something like this
$nextSeason = "";
foreach($list as $item){
$season = $item->season;
if($nextSeason != $season){
$nextSeason = $season;
echo '<h1>' . $season . '</h1>'
}
}
I have no clue how to accomplish this within the EE templating language
Here is the current code looping through the list:
{exp:stash:get_list:1 name="classes"
against="class_category_ids"
match="#(^|\&|\s){category_id}(.|$)#"
prefix="classes"
}
<div class="col-sm-3 class-info-container">
{classes:class_card}
</div>
{/exp:stash:get_list:1}
If i add {classes:season}
it is printing out the season for every item.
I also do not understand what the :1
is at the end of {exp:stash:get_list:1}
I have looked at the documentation for stash but it does not have a reference for this.
I believe this site is running EE 2