Hi,
I am working with nodewords, http://drupal.org/project/page_title and http://drupal.org/project/nodewords_pagetitle. This is working great on version 6.x.1.12.

On page_title I can set global_tokens, but also node_tokens, taxonomy_tokens, cck_tokens.

Could those tokens (other than global tokens) also be integrated in "custom pages meta tags" please?

Thanks a lot in advance for considering this!
greetings,
Martijn

Comments

Anonymous’s picture

It would be possible if the code could get a node object, or a taxonomy object.

Brian294’s picture

I will submit a patch that fixes this problem.

Brian294’s picture

StatusFileSize
new6.83 KB
new844 bytes

This patch doesn't work as expected, and should not be used; see the following comment.

Using the most recent -dev version (dated 6/15/2010), I created a patch. I am also attaching the nodewords.module (archived to nodewords.zip) file for anyone who wants to swap in the code changes with a simple file copy.

Peace,
Brian

Anonymous’s picture

Status: Active » Needs work

The patch is not in the correct format; see http://drupal.org/patch/create to understand how a patch is created.

The code as changed from the patch doesn't work.
In the case of custom pages, $options['id'] is not a user ID, nor a node ID; the calls to _nodewords_node_load($options), and user_load($options['id']) would return a random node, and a random user object that are not related with the page being viewed.

Brian294’s picture

Yes, you're correct with all of those observations. A perfect patch would need to take into consideration the type of path being accessed and then make sure only the relevant tokens are being loaded. This patch makes the assumption that the person creating the custom page knows which tokens are appropriate. For example, I would never use the user tokens if I am building a custom page for a node.

I'll give some more thought into how to address this issue.

Brian294’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB

CVS Patch attached using -dev version. Thank you for your patience as I figure things out.

Anonymous’s picture

Status: Needs review » Needs work

The patch is still using $options, but for custom pages that array doesn't contain any node ID, nor user ID.

Anonymous’s picture

Status: Needs work » Closed (duplicate)

This is actually a duplicate of #781440: Missing tokens.