A little similar to the views patch I just posted, this one provides a new token so you can link to the correct URL for comments in e-mails (e.g. notification module new comment e-mails).

CommentFileSizeAuthor
#7 389172_talk_token_6x_6.patch1.42 KBgreggles
token.patch1.26 KBowen barton

Comments

cwgordon7’s picture

Why can't this be handled by just using [comment-node-url]/talk or something similar, without needing to add a new token?

owen barton’s picture

Because some content types may have talk enabled, and some may not.

cwgordon7’s picture

Oh, tricky, nice. Isn't there a .token.inc file or something that we could put this code into that the token module will include automatically?

greggles’s picture

Isn't there a .token.inc file or something

There is not. You just put it in your module.

todd nienkerk’s picture

+1. Related token integration issue: #506658: Customizable titles everywhere using tokens.

greggles’s picture

Version: 5.x-1.3 » 6.x-1.x-dev

Here is basically the same patch updated for the way url() works in 6.x.

You can test it by adding something like this to your hook_comment and then posting a comment:

dsm(token_replace('monkey [comment-talk-url]', 'comment', $a1));

greggles’s picture

StatusFileSize
new1.42 KB
cwgordon7’s picture

Maybe it would make more sense to change the comment module's token rather than provide our own?

greggles’s picture

There currently is not way for one module to modify another module's token set. Instead you have to provide your own (this is due to the way hook_token_values is designed and the way that Drupal's module_invoke_all merges arrays).

greggles’s picture

Status: Needs review » Fixed

Committed to the 6.x branch. http://drupal.org/cvs?commit=237334

@Owen - thanks for your work on this. If you still want it for 5.x let me know and I'll see about committing there as well.

Status: Fixed » Closed (fixed)

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