Default sorting for page blueprints?

I’ve made a few websites using Kirby so far, which was generally a pleasant experience :slightly_smiling_face: However, there is one issue which keeps coming back, that I find a bit confusing:

It seems that it’s not possible to specify a default sorting for a page blueprint (if I want to sort by some non-numeric field).

For example, say that I have a page blueprint Person, and in general, I want to sort those by lastName. If I understand correctly, I need to call sortBy('lastName') on the collection of pages everywhere I use them (like in the templates, but also in the pages sections for the panel).

However, wouldn’t it make sense to specify a default sorting for page blueprints? In my opinion, a blueprint will often have one default way of sorting (like on first/last name for people). It feels a bit annoying that I need to specify this manually in several places, instead of configuring it at one place?

Of course there could always be exceptions, so keeping the sortBy() method for those situations is great. I just don’t get why I cannot specify one default sorting.

You could create a site controller where you make a variable for this sorted collection and use it sitewide?

For the frontend, you could use an already sorted collection: Collections | Kirby CMS

But then you would only create such a section once, and reuse if you need it multiple times. Seems pretty unlikely that you want to use the same sort field across different types of blueprints?

Thanks for your replies! Controllers or sorted collections could indeed work, but I still need to ‘manually’ apply the sorting in more place than just one.

Maybe to turn the question a bit around:

I can achieve a common sorting for pages using one num: definition in the page blueprint, but only when it’s based on numerical data (like a date). Why can’t I do something similar for non-numerical data (with alphabetical sorting)?