How to create paths that perform actions?

josepvalls - October 5, 2009 - 14:45

Hi,

Maybe my title is not very descriptive but I don't know how to really explain what I want to do.
The idea is to have certain urls that will perform certain tasks on nodes. I.E.
/node/123/publish will publish node 123
/node/123/unpublish will unpublish node 123
/node/123/status/ready will set a cck field status to ready
etc.
I plan on using those in two scenarios:
In views, I was thinking about adding a column with actions for each row
In some e-mails I send, there would be links to perform actions.

I saw that I can easily theme views to add the column or maybe I can use http://drupal.org/project/views_customfield or http://drupal.org/node/338454
I'd like to avoid using http://drupal.org/project/views_embed_form in favor of something simplier.
I thought that maybe there is some way to trigger actions by link but can't find an easy way. Any advice? Any module out there? Maybe I can use http://drupal.org/project/rules ?

I also saw http://drupal.org/project/views_embed_form, but I don't know much about the forms api.
Can I create forms that are only one button (with a hidden field maybe) and then will submit to some specific form processing url? I don't really need the email functionality, just some advice in how to start. I know basic php.

Thanks!

_

WorldFallz - October 5, 2009 - 15:03

You'll have to write a module to implement a menu callback. See http://drupal.org/developing/modules and http://drupal.org/node/102338 for more info.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

 
 

Drupal is a registered trademark of Dries Buytaert.