First of all this question is exact copy of this one (I'm sorry for that). But I don't get one thing.

My content-specific theme function works fine! I have a theme, called "nbttheme" and content type with machine name "nbt_text"

and declaration of

function nbttheme_node__nbt_text(&$variables) {
    return "hello";

does the work, I have only "hello" in node output. So the theme function EXISTS, contrary to what mr. Clive had said. Am I wrong?

And, if the theme function works then there must be a preprocess for it, called nbttheme_preprocess_node__nbt_text() but this doesn't work

So where am I wrong? It seems inportant for me and I want to understand Drupal's theming flow entirely.

P.S. This way has worked for with views, there is a template for row output in my project: views-view-fields--latest-additions.tpl.php, hence I would have had a nbt_views_view_fields__latest_additions() function for theming.

  • Have you tried to clear cache for theme registry? – Sithu Aug 21 '12 at 3:29
  • Yes, I've done this several dozen times:) – DimG Aug 21 '12 at 7:16
  • Have you tried the theme developer (devel_themer) module? It will provide naming suggestions for template and preprocesss functions. If that doesn't work, please post what it does suggest so I have a better understanding of the problem. – davidneedham Aug 21 '12 at 16:02

Your Answer

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

Browse other questions tagged or ask your own question.