Reference api: http://api.drupal.org/api/function/theme_field/7 I am trying to use THEMENAME_field__body__article() in my template.php to custom theme a field in only a specific custom content type. The problem appears to lie in the machine name given to the custom content type I have created.

I have a content type named "retailer profile" which was given a machine name retailer_profile. My theme name is Retailer so we try retailer_field__body__retailer_profile() to try and target only the body field when the content type is "retailer profile".

The problem is that this function is not recognized, but if we change the content type to "article" it will effect all articles with a body field. retailer_field__body__article() works and it seems the problem lies in the hyphenated machine name for the content type "retailer profile".

Now the theme name and content type share the common word "retailer" which could be a naming conflict that I am to new to be aware off.

I may have the Component as "other" since there was no listing for "field.module". It may also turn out to be not a bug and just a need for a note in the documentation.

Comments

mermentau’s picture

Edited the machine name of the custom content type from "retailer_profile" to "profile". After changing some CSS selectors and the file name of a .tpl file it works. Someone sharper than me will have to say whether this is a bug or need for documentation.

Version: 7.0-beta1 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.