-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Is your feature request related to a problem? Please describe.
Hello, I have content that is future-dated for upcoming events. Our current config uses the built template date tags path: "{{year}}/{{month}}/{{slug}}" as part of the path for where the file should be saved.
It would be great to use something like {{fields.date.year}} to get the date components from the collection field instead of the built-in date template tags. This would allow us to the path to match to the date in the front matter.
Is is possible to get the year, month, day from by doing {{fields.date.year}}, {{fields.date.month}}, {{fields.date.day}}.
Top level path setting for file location:
path: "{{year}}/{{month}}/{{slug}}" // would be great to reference {{fields.date.year}}, etc...
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
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)"
Describe the solution you'd like
Is is possible to get the year, month, day from by doing {{fields.date.year}}, {{fields.date.month}}, {{fields.date.day}}?
Describe alternatives you've considered
N/A
Additional context
N/A