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).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 389172_talk_token_6x_6.patch | 1.42 KB | greggles |
| token.patch | 1.26 KB | owen barton |
Comments
Comment #1
cwgordon7 commentedWhy can't this be handled by just using [comment-node-url]/talk or something similar, without needing to add a new token?
Comment #2
owen barton commentedBecause some content types may have talk enabled, and some may not.
Comment #3
cwgordon7 commentedOh, 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?
Comment #4
gregglesThere is not. You just put it in your module.
Comment #5
todd nienkerk commented+1. Related token integration issue: #506658: Customizable titles everywhere using tokens.
Comment #6
gregglesHere 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));Comment #7
gregglesComment #8
cwgordon7 commentedMaybe it would make more sense to change the comment module's token rather than provide our own?
Comment #9
gregglesThere 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).
Comment #10
gregglesCommitted 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.