0

I got a field with xyz as machine name, and I created a field--field-xyz.tpl.php template file, but it does not take any effect.
I used the template file to add views-field and views-field-field-xyz as CSS classes, but they don't show up.

What did I do wrong? Is it because I am using the Adaptive theme?

7
  • Have you tried clearing cache etc.?
    – Wtower
    Commented Feb 21, 2014 at 8:22
  • yes, i cleared it.
    – Sven
    Commented Feb 21, 2014 at 8:24
  • Where did you place the template file ? Is your base theme set correctly ?
    – AKS
    Commented Feb 21, 2014 at 10:03
  • @Wtower. The solution is, not just clearing the cache. You also have to flush theme caching. drupal.org/node/337176 How lovely it is .. spending hours for a solution like this. Great! Can't actually answer my own question..
    – Sven
    Commented Feb 21, 2014 at 11:59
  • Sorry, can't get the difference...
    – Wtower
    Commented Feb 21, 2014 at 12:02

1 Answer 1

0

Does xyz field name contain underscores?

Note that underscores in a Field's machine name are replaced by hyphens. Also remember to include "field-" in custom field names, e.g: field--field-phone.tpl.php.

https://drupal.org/node/1089656

EDIT: Add a hook_preprocess_field(&$vars) in your theme and dpm($vars) to check up on theme_hook_suggestions array for this field.

1
  • Thx, but that is not the solution, i know the suggestions. i am really frustrated. this should be a piece of cake.
    – Sven
    Commented Feb 21, 2014 at 10:38

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.