In D7, it seems the token for fields (e.g., [node:field_date]
) just returns the rendering of the field. So if the field is multi-valued, this token returns all the values rendered together. However, I'd like to be able to access specific delta values of the field separately using tokens, e.g. using [node:field_date:0]
or similar syntax. I also want to be able to chain the token, e.g. [node:field_date:0:long]
.
Has this been done before? My solution would be to use hook_token_info_alter
to mark the field's token as dynamic
, then do my own parsing in hook_tokens_alter
. But if I do this, will I lose the ability to chain the token?