In a theme, I am using the following preprocess function.

function dtv_preprocess_node(&$vars) {
  // Determine if the user is logged-in.
  if (user_is_logged_in()) {
    // Add a theme hook suggestion.
    $vars['theme_hook_suggestions'][] = 'node__youtube_media__auth';

Inside /templates/node there are two files.

  • node--youtube_media.tpl.php
  • node--youtube_media__auth.tpl.php

By now there is no change happening whether a user is logged-in or not.

Does someone see the error and is able to enlighten me?

  • Maybe due to misspelling media in the template name? – AjitS Jul 31 '16 at 9:12
  • corrected this and cleard cache but nothing happened either. – Josh Jul 31 '16 at 9:16
  • Theme debug says it uses the template froom the bas theme but not from the sub theme right now – Josh Jul 31 '16 at 9:18
  • node__youtube_media__auth 2 underlines before auth while node--youtube_media_auth.tpl.php there is only 1 underline before auth. Could that be it? – No Sssweat Jul 31 '16 at 9:27
  • seems to be a typo in here corrected that either. May be it is the Content types name I am not shure were to use high fins ad where to use low fins exactly – Josh Jul 31 '16 at 9:33

Browse other questions tagged or ask your own question.