Closed (won't fix)
Project:
Nodewords: D6 Meta Tags
Version:
5.x-1.8-rc1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2008 at 16:08 UTC
Updated:
2 Jul 2009 at 16:54 UTC
When I use this module with my CCK nodes, the Description tag that shows up on the page also has the node's Title tacked onto it. E.g., instead of the desired:
<meta name="description" content="This is the description" />
I get
<meta name="description" content="This is the TitleThis is the description" />
I changed description.inc to work around this, but I'm sure there's a better way than this. Here's what I changed in description.inc (existing all-comment lines removed for brevity):
BEFORE:
case 'node':
$node = node_load($ids[0]);
if ($node && node_access('view', $node)) {
if (filter_format_allowcache($node->format)) {
$node = node_build_content($node, TRUE, FALSE);
$content = drupal_render($node->content);
$node->teaser = $content;
node_invoke_nodeapi($node, 'alter', TRUE, FALSE);
$value = $node->teaser;
}
}
break;
AFTER:
case 'node':
$node = node_load($ids[0]);
if ($node && node_access('view', $node)) {
if (filter_format_allowcache($node->format)) {
$node = node_build_content($node, TRUE, FALSE);
// $content = drupal_render($node->content); /* Commented out as no longer necessary */
$node->teaser = $node->content['body']['#value']; /* Changed from ... = $content; */
node_invoke_nodeapi($node, 'alter', TRUE, FALSE);
}
$value = $node->teaser; /* Moved this line OUTside the prior "if" statement's "then" code */
}
break;
Got a better way? Did I do something wrong? Thanks.
Comments
Comment #1
ardee-1 commentedAddendum: this code change also fixed another problem I'd been having: the Description was also including text about the Fivestar ratings. I had had to turn off Fivestar for the teasers. But with this code change, I can put Fivestar back and the Description is unaffected.
Comment #2
ardee-1 commentedThere was at least one negative side-effect of what I did (above): the Fivestar ratings no longer appeared after the nodes. At least I think that was a side effect of this change, but I'm not really sure.
By the way, I also ended up commenting out this line:
because I don't see its purpose. (Is it actually modifying the node in the database? If so, why??)
Feedback appreciated!!
Comment #3
2c commentedAFAIK, node_invote_nodeapi is altering the node as presented to the site visitor, it isn't altering the database or making any permanent changes...it's on-the-fly node altering. Maybe this is the reason your fivestar widget isn't appearing after your node?
Comment #4
avpadernoAs the Drupal 5 version is not supported anymore, I am changing the status of this report.