Sort pages by datetime field in Panel

Hey there

I’m not sure if I am making a mistake or discovered a bug.

I have a Blog site with multiple blog article subpages. I would like to have the blog articles sorted by their “datetime” tag (in the panel). But the Kirby panel does not seem to name them accordingly, neither is the file structure.

I am using Kirby:
Toolkit version: 2.5.12
Kirby version: 2.5.12
Panel version: 2.5.12

here are the blueprints:


title: Blog
icon: book

    template: blogarticle
    sort: datetime desc
      mode: datetime
      field: datetime
      format: d-m-y H
      display: d-m-y H

       label: Title
       type:  text


title: Blogarticle
icon: file

pages: default

    label: Title
    type:  text

    label: Tags (Fach)
    type:  tags

    label: Date and Time
    type: datetime
    default: now
        format: DD-MM-YYYY
        format: 24

    label: Text
    type: textarea

And the panel looks like this:


While the file structure still is numbered (1-data-mapping, 2-embodied-ideation…)

Am I missing something?
Greetings M.

Hey, welcome to the forum! Yes, by default it will sort by the folder number. You need to tweak your blueprint a little to get what you want, which looks like you have basically followed, but check your indentation. YAML is sensitive to indents.

The format you are sorting by doesn’t match the format of the field - im not not sure if that matters or not.


thank you for the quick reply. I looked at the indentation, but that was not the mistake. The indentation was moved when I copied the text into the forum.

I found a solution though. By changing the num mode to date, it all worked out. The blog.yml file now looks like this:

title:       Blog
icon:        book

  template:  blogarticle
  sort:      datetime desc
    mode:    date
    field:   datetime
    # format:  dmy
    display: d.m.y – H:i

    label:   Title
    type:    text

It now makes sense to me that I had to use date instead of datetime. But I initially thought it would work with the type of datetime aswell.

Thanks for your help!

If you want to include the time in the numbering in the filesystem, you can do that using the format option. Just make sure not to use any dashes.