I have a module that I've created that implements custom Drupal Triggers for it.
What I would like to do is have the Token module actions made available to my module.
Currently when I create a Token Action it's only available to four of the default Drupal Triggers and not mine.
How do I add my Trigger to this in the most unobtrusive way so that Token Actions are available to it?
I've tried a few things on my own, but I think the best way is to ask you guys, the authors how you would recommended me doing this.
Thanks in advance for anything you can help me with.
Comments
Comment #1
djalloway commentedEDIT
Comment #2
djalloway commentedClosed it by accident, this question still stands.
Sorry for the confusion.
Comment #3
djalloway commentedI've found out how to get it to work, this issue is resolved.
For all others who would like to use Token actions in their custom Drupal Triggers, please note the following.
You module must define a hook_action_info() function, and instead of declaring your own actions (which I had no need of doing, but you may, who knows), you must append the necessary hooks into the Token module' declaration of it's hook_action_info() function, as the Token module hard codes only the Drupal defaults (nodeapi, comment, user, taxonomy).
This can look like the following.
So our module' action info hook is appending additional hooks to the Token module' declared action info hook' actions.
This is confirmed to work and I have a functioning dev site where my Trigger uses a Token action and successfully displays tokenized data.
If anyone has a better way to do this, or if I am complete incorrect in my approach please feel free to help a brother out.
Thank you.
Comment #4
gregglesI'd say that you've done a good job of figuring it out. Sorry I couldn't provide more support on this - it's not an area of Drupal where I have a great deal of knowledge (yet).
Comment #5
fagoyou could also use the rules module, then you won't have the troubles of hacking another module to make use of its actions for a new trigger (or event as it calles it rules). Just a suggestions.. ;)
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.