Posted by agitpropnik on July 28, 2012 at 2:28pm
I'm trying to write a basic custom module to alter field content before it is formatted, but I'm not sure which hook I need to implement.
My scenario: I have a Regular Hours and an Hours Exception content type each with an office_hours field. Based on a date argument, I want to alter the Regular Hours office_hours field before it is formatted with the Hours Exception information, if it applies.
It seems like this must be possible, but I can't figure out which hook to implement. I'm not even sure whether the hook should be a node hook or a field hook. I've been looking at hook_node_load primarily, but without success. Am I on the right track?
Thanks for any light you can shed on this.
Comments
If you want to change text
If you want to change text body on output, you need to create a custom input filter, and enable it on the input format of the text.
Jaypan We build websites
I haven't been using D7 for
I haven't been using D7 for almost 6 months, but I think you would want to check out the field API.