Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to override front page node tpl - drupal

How to override drupal front page node.tpl file ? I tried various

   node--front.tpl.php
   page--node--front.tpl.php
   page--front--node.tpl.php

but its not working.

What will be the file name to override home page node ? (I am working in drupal 7)

like image 530
Kamesh Jungi Avatar asked Sep 04 '12 17:09

Kamesh Jungi


2 Answers

You can add this function to theme template.php

   function customethemename_preprocess_node ( &$vars ) {

        if ($vars["is_front"]) {
           $vars["theme_hook_suggestions"][] = "node__front";
        }  
    }

Then you can page page--front.tpl.php

It will solve the problem

like image 143
Kamesh Jungi Avatar answered Sep 19 '22 23:09

Kamesh Jungi


It should be page--front.tpl.php

Also, be sure that you have the precursors in the hierarchy for your theme (e.g. page.tpl.php)

like image 37
Naidim Avatar answered Sep 17 '22 23:09

Naidim