By christodd on
I'm loving drupal. I've set it up, and it does everything that I'm looking for... well except one obvious thing - Meta Tag information.
The path alias module is helpful, but I thought that some meta tag information would be just as useful. So I hacked together a module for doing it...
Now, I can't figure out how to add a project here, so I put a project page together at http://www.bitesizeinc.net/project/metatags
The only real issue is that because how drupal is designed, it also requires a change to the themes in the header() function to actually implement this...
Comments
'because of the way Drupal is designed'
I think you missed the _head hook which can be used to add extra information to the <head> tag of a page.
But even if Drupal did not have such a hook, it would be much better to put all your functionality in a function, which themes could call cleanly. Your current method encourages code duplication and makes upgrading/removing a chore. Your metatag SQL queries (and even HTML tags) do not belong in a theme IMO.
Also, what do you mean with printing the meta tags in your h1/h2 tags? AFAIK meta tags are reserved for use in the head tag only...
Oh.. look at that
You're right... I didn't even notice the _head hook.... go figure
I agree about the modularizing part also
I think you are a bit mixed up about my meta tags and h1/h2 tags. I place the h1/h2 tags in the head of the document so that it appears before anything else for the search engines. Doesn't show in the browser, but it has a nice effect on search engine placement.
In fact, search engine optimization is the whole reason I wrote the meta module. If you combine this meta module with well chosen path aliases you can have some nice effects on your search rankings for chosen terms. But hey, I'm not giving away all my secrets here... you'll have to come to my site to see them ;P
-Chris
_head hook
The _head hook adds information based on the module, correct? Is there a way to specify metatags for a specific node?
www.blainepeterson.com
Is it necessary to add meta t
Is it necessary to add meta tags for each individual page or do all pages within a path inherit the tags from their parents? I think the latter would be of great value.
There is another attempt to implement meta tags called keywords. Here you can see what the _head hook thingie is about.
I like your implementation because it is more generic. Perhaps it would be useful to add other meta tags like "link" (see this example).
Another Meta Tag module
It looks like meta tags module is dead, at least I could not find it anymore. For those of you that need to manage meta tags, I recommend another module - http://drupal.org/project/nodewords
On 4.7.2 at least it works great, setup is smooth and usage is a piece of cake.
Thanks to authors and maintainers - Andras Barthazi, Mike Carter, Gabor Hojtsy and Robrecht Jacques!