Skip to content
Snippets Groups Projects
Commit 00b0a272 authored by mondrake's avatar mondrake
Browse files

Issue #2164599 by mondrake | sigalasgeo: Allow usage of Textimage tokens in Metatag.

parent 1a8ab7b5
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,7 @@ Features
* Field display formatters for Text and Image fields.
* Textimage API to generate Textimage images programmatically.
* Textimage tokens to retrieve URI/URL of generated Textimage images.
* Integrates with Metatag to use Textimage tokens in meta tags.
Requirements
......@@ -82,6 +83,8 @@ Recommended modules, for a feature rich set:
- Jquery Colorpicker (7.x-1.0-rc1 or later)
- Token (7.x-1.5 or later)
Integration with modules:
- Metatag (7.x-1.0-beta8 or later)
Installation instructions (long version)
----------------------------------------
......@@ -411,6 +414,9 @@ where:
field); if not specified, a comma-delimited string of all the URLs/URIs
generated will be returned.
Textimage tokens can be used with the Metatag module to specify e.g. URL
meta tags.
-------------------------------------------------------------------------------
......
......@@ -284,6 +284,24 @@ function textimage_tokens($type, $tokens, array $data = array(), array $options
return $replacements;
}
/**
* Implements hook_metatag_token_types_alter().
*
* Integration of Textimage tokens with the Metatag module.
*/
function textimage_metatag_token_types_alter(&$options) {
// Add Textimage tokens to the token types managed by Metatag,
// for the node context.
if ($options['context'] == 'node') {
if (!isset($options['token types'])) {
$options['token types'] = array();
}
if (!in_array('textimage', $options['token types'])) {
$options['token types'][] = 'textimage';
}
}
}
// There is not a way to specify a file in hook_image_effect_info.
// Effects .inc files are included here for the time being.
require_once 'effects/textimage_background.inc';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment