Commit 00506d1b authored by osopolar's avatar osopolar Committed by Ra Mänd
Browse files

Issue #2681291 by osopolar: Token for fieldcollection delta

parent f54fe1fa
......@@ -28,6 +28,10 @@ function field_collection_token_info() {
'name' => t('Host entity ID'),
'description' => t('The entity ID of the host. For nodes this is <code>nid</code>, for users <code>uid</code>.'),
);
$host['delta'] = array(
'name' => t('Host entity item delta'),
'description' => t('The delta of the reference pointing to this field collection item.'),
);
// Chained tokens.
foreach (field_collection_host_entity_types() as $entity_type => $entity_info) {
......@@ -96,6 +100,7 @@ function field_collection_tokens($type, $tokens, array $data = array(), array $o
'type' => 'hostEntityType',
'bundle' => 'hostEntityBundle',
'id' => 'hostEntityId',
'delta' => 'delta',
);
$entity_types = field_collection_host_entity_types();
foreach ($tokens as $name => $orig) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment