0

I have a field called field_news_title. I want to override its output so I created a file called field--field-news-title.tpl.php in my_theme/templates folder but it's not working. I tried also to put the file in my_theme root dir and in news content type dir. What am I doing wrong?

6
  • Cleared cache ?
    – AKS
    Oct 5 '12 at 12:19
  • Yes, cache clear from admin interface.
    – bogtan
    Oct 5 '12 at 12:20
  • I also tried to override the field.tpl.php but with no success.
    – bogtan
    Oct 5 '12 at 12:23
  • field--field-news-title.tpl.php is always an override of field.tpl.php. Looks like your theme template name is correct as per drupal.org/node/1089656 though
    – AKS
    Oct 5 '12 at 12:29
  • Can you override anything? What about block, node etc?
    – Alex Gill
    Oct 5 '12 at 12:55
2

I tried with field name field_article_current_rating and I have created the template file called field--field_article_current_rating.tpl.php and it is working.

So I think in your case you should try field--field_news_title.tpl.php

And one more thing I put this file in

/sites/all/themes/theme_name/templates

folder, as I am using Omega subtheme.

2
  • I have created a sub-theme of Drupal Twitter Bootstrap theme. Is it possible that the problem is coming from TB theme?
    – bogtan
    Oct 8 '12 at 12:32
  • Not at all. Simply you have to create a tpl and put with all tpls like node.tpl.php, page.tpl.php etc. Oct 8 '12 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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