1

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');
Marko
  • 20,385
  • 13
  • 48
  • 64

1 Answers1

-1
$entity_field[0]['value'] = $field_event_date->format('Y-m-d');
mahendran
  • 1
  • 1