Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
field_collection
Commits
00506d1b
Commit
00506d1b
authored
Mar 01, 2019
by
osopolar
Committed by
Ra Mänd
Mar 01, 2019
Browse files
Issue #2681291 by osopolar: Token for fieldcollection delta
parent
f54fe1fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
field_collection.tokens.inc
field_collection.tokens.inc
+5
-0
No files found.
field_collection.tokens.inc
View file @
00506d1b
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment