I'm working in a site that has implemented the template_preprocess_field() hook. I want to change the content of a field but the code works for all the nodes except for the nodes of a content type that have a custom template (
node--emploi.tpl.php) It's strange because I have another template for the nodes of the content type named tarif (
node--tarif.tpl.php) and in this case the hook is called.
Here the piece of code inside the template node--emploi.tpl.php file:
<div class="editor"> <?php /* At this point the body's h2 do not know what the nid is, so a quick and dirty replace will set it right. */ print preg_replace('/NO-NID[a-z0-9]*--/', $nid . '--', check_markup($field_stm_emploi_temoignage_body['value'], $field_stm_emploi_temoignage_body['format'])); ?> </div>