Implementing hook_field outside cck field modules

Events happening in the community are now at Drupal community events on www.drupal.org.
pvhee's picture

I would like to implement extra functionality on specific CCK fields operations. For example, I have a link CCK field in some content type. When a value, eg a website link, is entered in that field, I automatically want to set up a feed using that link. To do this, I am now altering the entire node form using hook_nodeapi(), filtering out the correct content type and then reading the field value. I thought it would be nicer to hook up my custom action (creating the feed from the link) directly to the CCK field.

I looked into hook_field but I found out that only modules implementing the specific CCK field are called. For example, link_field() will be directly called by the content module, thus I cannot write my own hook_field function. Is there any workaround this? Is it possible to hook up some actions on CCK field operations?

This could be generalized to eg drupal actions and triggers. Imagine to write custom triggers such as 'if an entered value equals x' then a custom action such as sending an email could be fired. Are there any plans with CCK to implement this kind of functionality, or does something similar exist?

Comments

That's right, this is

yched's picture

That's right, this is currently not possible in CCK D6.
The current work on 'fields in D7 core' exposes many more hooks that let 3rd party module take action on most steps in the fields workflow (see http://api.jaspan.com/api/file/modules/field/api.field.php and the fied_attach_* hooks, if you're interested)

Once this has settled, maybe a limited D6 backport be considered (probably if someone volunteers to do the job...)

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: