I have used given below code for node--[content_type].tpl.php (default) template file

function MYMODULE_theme($existing, $type, $theme, $path) {
  return array(
    'node__NODETYPE' => array(
      'render element' => 'content',
      'base hook' => 'node',
      'template' => 'node--NODETYPE',
      'path' => drupal_get_path('module', 'MYMODULE') . '/templates',

but I don't know how to call my node--[content_type]--[view_mode].tpl.php

Please suggest.

  • "If the question is about code you wrote, for which you want to write better code, or you want to understand why it doesn't work, show the code you are using, or the part of the code that is relevant for the question." - see Help Center
    – Mołot
    Jun 17, 2015 at 12:34

2 Answers 2


You can use node--[content_type].tpl.php for changing the output for view mode.

if ($teaser) { 
  // node is being displayed as a teaser

} else { 
  //all other cases  

in your theme template.php on function THEME_NAME_preprocess_node(&$variables) put the

$variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode'];

then on the theme copy node.tpl.php to node--article--full.tpl.php (for example) and edit as you want.

Now, you can have template for each content type and for each view mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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