How do I prefix the year on a blog?

I would like to sort a blog by year and prefix the year, like this example:

Sorting by date works perfectly. However, how to prefix the year is beyond my knowledge …
Did I miss a cookbook?

You probably mean group by year, because that’s what has been done on the example you posted.

Thank you. This cookbook I have read, however, I do not find instructions to output the year separately and list below it all the posts that belong to that year. In the cookbook I only recognize the listing and sorting of the contributions by date. Or do I no longer see the forest for the trees?

That’s exactly what the example I linked to does. First under “Complex grouping”

Probably the example does not work, because I use the “notes” section from the starterkit. There are used collections, controllers, models. Unfortunately I am helpless where and what changes to make.

Well, you have to change the definition of $notes in the controller, and then the output in the template.

Thank you. I didn’t immediately recognize the example in the cookbook as a suitable solution, since a screenshot of the result is missing. Basically screenshots to the recipes would be a visual help. Especially for newcomers. But I can also understand that it is very time-consuming to keep the many screenshots up to date. Especially with the release of a new version.

Back to my question and your suggestion:
Now it happens that I have already renamed many variables and can’t get the recipe to work. These are the downsides of beginner mistakes then…
I’m worried that other errors will occur if I change too much on my controllers.
For the next project I will stick more to the cookbook recipes.