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?

Replay

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

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

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