You are here

function textimage_token_info in Textimage 8.3

Same name and namespace in other branches
  1. 8.4 textimage.module \textimage_token_info()
  2. 7.3 textimage.module \textimage_token_info()

Implements hook_token_info().

File

./textimage.module, line 109
Textimage - Provides text to image manipulations.

Code

function textimage_token_info() {
  $type = [
    'name' => t('Textimage'),
    'description' => t('Tokens related to Textimage'),
    'needs-data' => 'node',
  ];
  $tokens = [
    'uri' => [
      'name' => t("URI"),
      'description' => t("The URI(s) of a Textimage generated for a node's field. Use like <strong>[textimage:uri:field{:display}{:sequence}]</strong>, where:<br/><strong>field</strong> is the machine name of the field for which the Textimage is generated (e.g. body or field_xxxx);<br/><strong>display</strong> is an optional indication of the display view mode (e.g. default, full, teaser, etc.); 'default' is used if not specified; <br/><strong>sequence</strong> is an optional indication of the URI to return if Textimage produces more images for the same field (like e.g. in a multi-value Image field); if not specified, a comma-delimited string of all the URIs generated will be returned."),
      'dynamic' => TRUE,
    ],
    'url' => [
      'name' => t("URL"),
      'description' => t("The URL(s) of a Textimage generated for a node's field. Use like <strong>[textimage:url:field{:display}{:sequence}]</strong>, where:<br/><strong>field</strong> is the machine name of the field for which the Textimage is generated (e.g. body or field_xxxx);<br/><strong>display</strong> is an optional indication of the display view mode (e.g. default, full, teaser, etc.); 'default' is used if not specified; <br/><strong>sequence</strong> is an optional indication of the URL to return if Textimage produces more images for the same field (like e.g. in a multi-value Image field); if not specified, a comma-delimited string of all the URLs generated will be returned."),
      'dynamic' => TRUE,
    ],
  ];
  return [
    'types' => [
      'textimage' => $type,
    ],
    'tokens' => [
      'textimage' => $tokens,
    ],
  ];
}