Kirby Panel sortBy for select of tags

I’m looking for a way in Panel, in the YAML for a select field, to make sure that tags are displayed alphabetically.

Here is the code for the select.

              category:
                label: Kategorie
                type: select
                options:
                  type: query
                  query: site.find("page").categories.split
                  value: "{{ arrayItem.value }}"

On the other page I just generate the tags

 categories:
    label: Kategorie
    type: tags

Best regards

You can use a page model, and inside that model create a method that returns the array of categories in sorted order. then in your query, for example:

query: site.find("page").getSortedCats() # meow ;)