Closed (fixed)
Project:
Nodewords: D6 Meta Tags
Version:
5.x-1.9
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2008 at 16:34 UTC
Updated:
12 Aug 2008 at 10:32 UTC
I'm using the nodewords_bypath module. The problem with it is that it overrides the meta tags that are entered for specific nodes. To fix this I've added some token providing modules to nodewords.module. The code is below. Will this create any problems? Is it useful?
Thanks,
Moses
/**
* Implementation of hook_token_values().
*/
function nodewords_token_values($type, $object = NULL, $options = array()) {
if($type = 'node'){
$tokens['meta-keywords'] = $object->nodewords['keywords'];
$tokens['meta-description'] = $object->nodewords['description'];
return $tokens;
}
else{
return;
}
}
/**
* Implementation of hook_token_list() for Pathauto specific tokens
*/
function nodewords_token_list($type = 'all') {
$tokens = array();
if (module_exists('nodewords_bypath')) {
if ($type == 'node' || $type == 'all') {
$tokens['node']['meta-keywords'] = t("The meta keywords");
$tokens['node']['meta-description'] = t("The meta description");
}
}
return $tokens;
}
Comments
Comment #1
Robrecht Jacques commentedWhy is there:
Can't the tokens be made available even if nodewords_bypath is not enabled?
Why is there:
Should something similar not be in nodewords_token_values? I mean: you handle the "all" case here, but not in nodewords_token_values.
Is it possible to always have tokens for all tags? And added to the "global" (or is that "all") token context instead of just "node" context?
Comment #2
Robrecht Jacques commentedComment #3
Robrecht Jacques commentedCommitted. Will be included in the next release of nodewords (5.x-1.10) released later this week.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.