We've been there: folder names with leading numbers


I’ve read through a bunch of older articles here in the forum, and have read the article about sorting of subpages, yet I am trying to wrap my head around the following scenario:

I have a client who generates his project numbers in the following format: Group + Year + Ascending number + project name, resulting in an (offline) folder structure like this:


Now I am trying to mimic this folder structure in Kirby. By prepending a 0- to the folder name (which I find a bit cumbersome to be honest):


and my ‘pages’ settings like this:

  num: zero
  sort: false

Kirby outputs the desired order on the frontend – so far, so good. But while the folder names remain untouched, the leading number still gets stripped in the Panel Sidebar, so it reads

Project A
Project B
Project C

Hence my questions:

  1. Is there any way to display the leading number in the Panel Sidebar so it reads ‘021701 project a’ (or even 0-021701-project-a)?

  2. Is there any way to reverse the sorting order in the Panel, so the latest entries are on top? (sort: flip renames the whole folder structure as I found out – not what I want)

  3. Is there a more elegant way to tackle his topic (e.g. not having to prepend 0- to folder names)?

I’d appreciate any pointers!

The problem is that numbers in front of a UID are basically not possible, at least if you use a dash. While this works if you don’t use the panel, you will run into issues sooner or later if you do. A leading number is always regarded as a visibility flag.

Thanks @texnixe.

Another thought – would it be possible to output the value of a custom field (say the field ‘projectnumber’ within a project) in the Sidebar panel (basically a column next to the title)? If that’s possible, I’d be willing to give up on the idea of having the project number in the folder name (although that would make content editing via folder structure so much easier).

No, that’s not possible. Or rather, it is of course possible, but you would have to modify the panel core subpage snippet.

Edit: Maybe it would also be possible to use a field to inject a new column via JavaScript, but I think that would be rather hacky.