Alter a template whether a user is logged-in or not

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?


Category: 7 Time: 2016-07-31 Views: 4
Tags: theming

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.171 (s). 12 q(s)