QUESTION: Date-based numbering

I’m having trouble getting the Kirby Panel to generate YYYYYMMDD (Ymd) formatting for new posts according to what (I think) the docs say to do here: http://getkirby.com/docs/panel/blueprints/page-settings

Has anyone personally set up data-based posts and, if so, do you see anything I’m missing here:

CloudApp

Better image of both folder structure and blueprints:

CloudApp

So, not sure if I got that right: The problem is this test2 folder which should have been created with a leading date format, is that correct?

Is there a specific reason why you are trying to get a date format like YYYYmmdd and not just the default Ymd which already should result in something like 20150302?

Also, there is no such date format in PHP: http://php.net/manual/en/function.date.php

As @distantnative said, the default is already an output like 20150302.

I hear you all about the date format. I will try to capture the errors I was seeing with Ymd, but basically it was showing “Y91” or “Y93” in the datepicker on the panel and I got confused between the storage format and the output format.

I think the real thing that was tripping me up is that when I made a new test post, it was invisible by default (which is good) but that means it wasn’t getting any kind of folder prefix. When I went into the post sorting/editing page and dragged it from invisible to visible, it got the right prefix. duh

Thanks so much. I will leave this open until I can post the final YAML that worked (for me), but I think I got it from here.

Max

Datepicker? There are two different things:

  • The date field in a text file which can be formatted in the blueprint which has a default format of YYYY/MM/DD
  • And the date as prepended to the folder name (which has the format Ymd by default and can be formatted according to the php date formatting options)

So I’d say what you wanna do is this:

Year

pages:
  num: date
  field: pubdate
  sort: flip

Post

pubdate:
  label: Publication Date
  type: date

Or do you actually prefer something like YYYYMMDD instead of the default YYYY/MM/DD for the panel field (“datepicker”)?