Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have searched the issues and the git commits, but could not find a reference as to why this was dropped nor could I find an (open) issue of a similar request.
I propose to re-introduce the callback arguments to the API, so that you could do something like:
/**
* Implements hook_nodewords_tags_info().
*/
function nodewords_custom_tags_nodewords_tags_info() {
$objects = nodewords_custom_tags_get_objects();
if (count($objects)) {
foreach ($objects as $object) {
$tags[$object->name] = array(
'callback' => 'nodewords_custom_tags_callback',
'callback arguments' => array(
'name' => $object->name,
'type' => $object->type,
'title' => $object->title,
'description' => $object->description
),
'context' => array(
'allowed' => array(
NODEWORDS_TYPE_DEFAULT,
NODEWORDS_TYPE_NODE,
NODEWORDS_TYPE_PAGE,
),
),
'label' => $object->title,
'templates' => array(
'head' => array(
$object->name => NODEWORDS_META,
),
),
);
}
}
return $tags;
}
This is a module (nodew)rds_custom_tags) we developed for a customer where you are presented with an interface to create any additional metatag 'on the fly' without the need for development.
Patch for this in attach.
Cheers,
mlc.
Comment | File | Size | Author |
---|---|---|---|
#1 | callback_arguments.patch | 2.6 KB | malc0mn |
callback_arguments.patch | 1.18 KB | malc0mn |
Comments
Comment #1
malc0mn CreditAttribution: malc0mn commentedThat wasn't the right patch, was it... Now it is :-s
Comment #1.0
malc0mn CreditAttribution: malc0mn commentedremoved tokens
Comment #2
DamienMcKennaComment #3
DamienMcKennaThank you for taking the time to work on this. However, the module is no longer supported, so I'm closing this issue.