Closed (fixed)
Project:
Nodewords: D6 Meta Tags
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Oct 2006 at 18:53 UTC
Updated:
14 Dec 2006 at 11:15 UTC
The 'Use the teaser of the page if the meta description is not set?' functionality does not seem to be compatible with CCK....
might this be a problem correlated to CCK not featuring proper default teasers?
I also tryed defining teasers for my CCK types with phptemplate files (node-content_type.tpl.php) and with the Contemplate module, but still they are not recognized by Nodewords...
any chance to see this work?
Thank you very much!
Comments
Comment #1
toma commentedI have the same problem here, so my all site get ignore some pages in the search engine, any solution for that
Thank you
Comment #2
Robrecht Jacques commentednodewords doesn't use the theming template, it uses
$node->body. Unfortunately, CCK doesn't seem to populate$node->bodyas it should. I'll look into this more closely next week.Comment #3
toma commentedthank you so much for that, its really important the key words module, its a good idea to added in drupal core
Thanks
Comment #4
marcoBauli commentedThank you Robrecht, seems that description is more relevant than keywords in SEO, so this is very desirable functionality!
+1 tester :)
Comment #5
scb commentedCCK doesn't populate body nor teaser fields. You may do that manually, using this piece of code proposed by Duke:
http://drupal.org/node/69981#comment-160952
This should make it work, I think.
Comment #6
toma commentedThanks sergiocaridad, but i don't really get that solution to work, can someone try to explain what we can do ! make a new module for each content type, i don't understand really
Comment #7
Robrecht Jacques commentedIt's a solution that can be used in nodewords. Strange that CCK doesn't do it by default. I will try to implement it inside nodewords.module next wednesday.
Comment #8
Robrecht Jacques commentedI have fixed the bug that made nodewords use an empty DESCRIPTION for CCK nodes (as a side effect of fixing http://drupal.org/node/89067) and have put instructions in README.txt to advise users to use contemplate module to adapt the auto-generated content.
Please check if this solution (nodewords.module version 1.32.2.13) solves your concerns.
Comment #9
Caleb G2 commentedI've got the contemplate module and the most recent nodewords module (version 1.32.2.13) active, but I cannot get an automatic description to show up for me (it will if I manually enter one).
Can someone expand on these instructions in the README.txt a bit:
What do I need to add to the teaser in contemplate to get nodewords to automatically generate a description?
Comment #10
Robrecht Jacques commentedSuppose you create a CCK node with a title, a body and a color field. The default teaser for this will be:
Now nodewords strips all markup for the meta description tag and will thus have
bodySome placeholder text. colorredas meta description, which is probably not what one wants.If you go to
administer >> content >> templates(which appears if you install the contemplate module), you can create a template for this cck type. For example you could set the teaser template to:For the same node above this will create following teaser:
And the autogenerated meta description will become
Some placeholder text. I am red.So by modifying the teaser template with contemplate, you can change the auto-generated meta-description.
Is this helpful?
Comment #11
Caleb G2 commentedHm. I guess my situation is similar to but not exactly like the CCK situation then. What I've done is use contemplate along with the standard Drupal "blog" node-type and the excerpt module to create separate teaser and body text input areas so that my users don't have to worry about using the break command anymore.
So in contemplate right now what I have for the teaser is:
<?php print $teaser; ?>and what is contemplate's body field is:
<?php print check_markup($teaser); ?><?php print $body; ?><p></p>Is there something easy I can tack onto those areas to get the auto description working?
Comment #12
marcoBauli commentedrobrecht: tested the new version and creates beautyfull meta descriptions as promised (it also trims the text lenght to 255 chars, wow!) Thank you so much man :D !
caleb: sorry, not sure what are you really meaning here..For CCK, print $body and print $teaser are not good choices, but don't know about blog+excerpt. Basically Contemplate works with any sort of node type, the only thing is to pick the right variables (you should see a list of the exposed ones in the fields on the right in the template settings page, but you can use or expose more than these with some trickery/hack in the modules. Have a look in the issue queue of Contemplate, there are a couple of posts talking more about this).
Comment #13
Caleb G2 commentedThis probably only useful for me since I'm running a fairly atypical setup, but I figured out how to get the auto description working by just changing this line in the nodewords.module
$tags['description'] = $node->teaser;to$tags['description'] = $node->body;.This is because the way I have things set up all the info for the node gets put in the body field/database table and the teaser is actually just generated citrually from the body. Bottomline it works. :)
Comment #14
Caleb G2 commentedSorry to be a pain...but I've got a strange situation whereby two separate sites, which seem to be identical in all the ways that should matter, won't both display auto description using the hack I made above (though the site that is not autogenerating does display it if I manually type in the description). I tried to isolate the problem/difference for hours, but I just can't see what is dis-similar between them (tried dragging templates back and forth, disabling modules, run file diff's, taking the hack out, etc.)
So the question is - is there a way to put a statement in the head section of page.tpl.php which would force the auto generation of a description?
I've tried putting this in the head section of page.tpl.php without success:
<?php $tags['description'] = $node->teaser; ?>and...
<?php $tags['description'] = $node->body; ?>Any suggestions?
Comment #15
Robrecht Jacques commentedCaleb G, please contact me personally either by email (use my contact form) or on IRC (#drupal-support) to solve your specific problem.
Nodewords never uses $node->body, it only uses $node->teaser. Probably that's your problem.
Setting it as fixed (as the original issue was fixed).
Comment #16
(not verified) commented