Hello, I have content that is future-dated for upcoming events. Our current config uses the built template date tags path: "{{year}}/{{month}}/{{slug}}"
to build the path for saving the file.
The docs suggest using {{fields.date}}
. Is it possible to get the year, month, day like {{fields.date.year}}
to get the date components from the collection field instead of the built-in date template tags? Maybe this Summary string template transformations?
This would allow us to the path to match to the date
in the front matter without having to manually rename and move the file.
The content date field is a datetime type.
Collection field to reference in path
for content type:
- label: "Start Date/Time"
name: "date"
widget: "datetime"
dateFormat: "YYYY-MM-DD" # e.g. 2021-11.23
timeFormat: "HH:mm" # e.g. 21:00
format: "YYYY-MM-DD HH:mm:00 -0500"
hint: "The start date and time of the event (Note: uses a 24hr clock, e.g. 13:00)"