nodewords hook (easy entry point for token support in 1.x branch)

hanoii - May 26, 2008 - 22:18
Project:Meta tags
Version:5.x-1.8
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

This issue is somehow related to a few already entered here and some postponed. (#214206: Token Integration, #232208: Meta Tags on a content type basis + tokens?).

I also needed some kind of token replacement and instead of heavily patching the module I am suggesting this approach which might be good to port to 2.x branch as well, and that is, having a nodewords hook that modules might implement to do further processing on the tags. I read that the new branch will have token support so this may stay in 1.x branch but it's ready to be used now.

The patch is just a new _nodewords_invoke() function that is very much the same that node.module uses for nodeapi. And I added a 'prepare' operation for the hook just before preparing tags by the included functions. In this way modules can process tags before they are passed to the actual nodewords tags.

I probably soon commit a module called nodewords_token which will use this hook and will add the ability to have global descriptions per content type using tokens.

I believe this is a very light patch plus very powerful for us module developers so we can contrib to this module without heavy patching.

Looking forward to hearing community and developers comments.
Ariel.=

AttachmentSize
nodewords.module.patch1.4 KB

#1

hanoii - May 26, 2008 - 22:19
Title:nodewords hook» nodewords hook (easy entry point for token in 1.x branch)

#2

hanoii - May 26, 2008 - 22:19
Title:nodewords hook (easy entry point for token in 1.x branch)» nodewords hook (easy entry point for token support in 1.x branch)

#3

hanoii - May 29, 2008 - 03:39

Here is the support module I built with this patch: Meta Tags Node Type

#4

Todd Nienkerk - June 2, 2008 - 22:26

+1 this feature. I LOVE the hook. Very, very useful for customized meta tags requests.

#5

Todd Nienkerk - June 3, 2008 - 18:10

I'd also like to add that one of my coworkers will be building a module that implements the hook defined by this patch. The module will allow custom meta data by path, which would effectively allow any non-node page to display custom data.

#6

Shannon Lucas - June 17, 2008 - 18:48

Meta tags by path requires this patch. It allows the value of meta tags to be controlled on a per path basis.

#7

Robrecht Jacques - June 18, 2008 - 09:54
Status:patch (code needs review)» fixed

Committed. Will be included in 5.x-1.9. Thanks a lot! Also for the two wonderful modules!

#8

Anonymous (not verified) - July 2, 2008 - 10:05
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.