function token_insert_entity_token_info in Token Insert Entity 7
Implements hook_token_info()
Adds a custom token to render a full entity using a display mode.
File
- ./
token_insert_entity.module, line 59 - Hook implementations for token_insert_entity module.
Code
function token_insert_entity_token_info() {
return array(
'types' => array(
TOKEN_INSERT_ENTITY_TYPE => array(
'name' => t('Embed content'),
'description' => t('Inserts a fully rendered content using a view mode.'),
),
),
'tokens' => array(
TOKEN_INSERT_ENTITY_TYPE => array(
'render' => array(
'name' => t('Render a piece of content'),
'description' => t('Render a piece of content using the pattern [@token:render:teaser:node:1].', array(
'@token' => TOKEN_INSERT_ENTITY_TYPE,
)),
),
'link' => array(
'name' => t('Link to related item'),
'description' => t('Link to the related item using the pattern [@token:link:node:1]. ' . 'Text overrides cannot contain spaces, use %% instead.', array(
'@token' => TOKEN_INSERT_ENTITY_TYPE,
)),
),
),
),
);
}