2

I think this may be related to using "tokens" when developing a module, but I am seeing this:

'og:updated_time' => array('value' => '[node:changed:custom:c]'),

The question I have is about: [node:changed:custom:c]

What is this? What is it even called?

In my particular case, I am adjusting a module to retrieve a new value from a custom field.

'og:image' => array('value' => '[node:field_social_image]')

I have successfully used this for other custom fields, using the exact same syntax, but this one does not work.

2 Answers 2

2

These are the tokens, more specific a custom/dynamic tokens implemented by Drupal core (token.inc) and managed by Token module.

See: List of tokens page for more details:

Custom format [node:changed:custom:?] "?" is a single, unquoted PHP date formatting character. Use this token multiple times to build a full custom format.

1
  • 1
    Interesting! Hope it's OK I added that link in your answer ... Jul 30, 2016 at 12:59
1

If your field_social_image is not a date field (it's probably an image field ...), and taking into consideration the accepted answer from kenorb, it would explain why that that "c" doesn't work.

Because it's a PHP date formatting character, i.e. related to "ISO 8601 date (added in PHP 5) 2004-02-12T15:19:21+00:00"

In other words: use "c" only for date fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.