Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The token support in Drupal 7 does not include year, month, day or since. Especially year, month and day would be very useful with Pathauto for example.
Year: 2010 or 10
Month: 1, 01, Jan, January
Day: 1, 01
Weekday: 1, Monday
Week: 1, 01
Since: 1, one, 2, two... (I don't see the need for 01)
Comment | File | Size | Author |
---|---|---|---|
#3 | Selection_028.png | 109.74 KB | Dave Reid |
Comments
Comment #1
Dave ReidAny date tokens in D7 can have a 'custom' format.
[node:created:custom:yyyy mm dd]
And all date tokens do have a 'since' value:
[node:created:since]
Comment #2
tsvenson CreditAttribution: tsvenson commentedWow, that is simply awesome. Took a quick look in the help file and it is a really nice improvement.
Over all, the changes in how to format and use tokens in Drupal 7 is such an improvement.
I think a link in the token lists to the help file could be added when not all available tokens are listed?
(Now smacking myself for not discovering this sooner)
Comment #3
Dave ReidIf you're using a module which shows the token tree UI (like the latest pathauto), this is what you see, so I'm not sure we need to add any documentation on this.