I have added the following function in my theme's template.php to test whether it actually gets called when adding or editing a node, but for some reason it is not!

function mytheme_preprocess_field(&$variables, $hook) { die('FINALLY!'); }

I have done everything I could think off, refresh cache (all of them), restart apache, restart server, no matter what I do, it is not called. As soon as I go to the frontpage, it is called.

Can someone give me some pointers where I might look next? Thanks!


1 Answer 1


I believe the theme functions are called on render (as in view) and not the add/edit pages. If you want to affect the markup of the fields on the add/edit forms you would use a hook_form_alter or hook_form_FORM_ID_alter() and change the render array there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.