Skip to content

Commit

Permalink
Merge pull request #44 from argiepiano/1.x-2.x-issue-43
Browse files Browse the repository at this point in the history
Issue #43. Wrap term tokens on if statement to check for taxonomy
  • Loading branch information
argiepiano authored Aug 4, 2023
2 parents 51721a9 + 50c5bd4 commit 8225fce
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions entity_token.tokens.inc
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,20 @@ function entity_token_token_info_alter(&$info) {
'entity-token' => TRUE,
);

// Tokens for type term.
$info['tokens']['term']['parents_all'] = array(
'name' => 'All parent terms',
'description' => t('Ancestors of the term, i.e. parent of all above hierarchy levels.'),
'type' => 'list<term>',
'entity-token' => TRUE,
);
$info['tokens']['term']['weight'] = array(
'name' => 'Weight',
'description' => t('The weight of the term, which is used for ordering terms during display.'),
'entity-token' => TRUE,
);
if (module_exists('taxonomy')) {
// Tokens for type term.
$info['tokens']['term']['parents_all'] = array(
'name' => 'All parent terms',
'description' => t('Ancestors of the term, i.e. parent of all above hierarchy levels.'),
'type' => 'list<term>',
'entity-token' => TRUE,
);
$info['tokens']['term']['weight'] = array(
'name' => 'Weight',
'description' => t('The weight of the term, which is used for ordering terms during display.'),
'entity-token' => TRUE,
);
}

// Add types and tokens for all properties of entities that don't have one.
$entity_info = entity_get_info();
Expand Down

0 comments on commit 8225fce

Please sign in to comment.