In Drupal 7, I have an Event content type. When saved, I want it's URL to be /calendar/day/{yyyy-mm-dd}/{title}, where {yyyy-mm-dd} is based on field_event_date
. The Token module can do this for create & change date fields, but not for a custom field I created, called field_event_date. So, to compensate, I want to create a computed field called field_event_date_Ymd
, which stores the yyyy-mm-dd format from field_event_date
, so that I can reference it in the URL pattern.
I'm not a PHP programmer, so can someone help me with the code for this? Is it something like this?
$entity_field[0]['value'] = $field_event_date->format('Y-m-d');