0

I need some help with this one. I have looked all over here for an answer, found a similar question but the answer did not work for me. I have set up a new page in drupal 7 titled "new-setup". The node ID for this page is 3. I have created a custom theme 'new-theme' which exists as a folder within sites/all/themes. Everything is good up to this point...this is the default theme for new pages added. However I need to set up a page template for my "new-setup" page. I have added a templates foder within my 'new-theme' and added a 'page-node-3.tpl.php' template as my 'new-setup' page has a node ID of '3'. On other boards, this seems to be the proper route for setting up a template, but I have tried for several hours and cannot get it to work. Any help is much appreciated!

JordanBarber
  • 2,041
  • 5
  • 34
  • 62

3 Answers3

3

Create page--node--3.tpl.php file in your themes directory & clear cache.

Vishal Patil
  • 485
  • 4
  • 15
1

in a template.php on your theme directory put something like

XXXX_preprocess_page($vars) { 
    if (isset($vars['node']) && $vars['node']->id == 3 ) { 
        array_unshift($vars['theme_hook_suggestions'], "page__bar"); 

    }
}

this will use page--bar.tpl.php for node of id 3 XXXX should be replaced by your theme name

Ôrel
  • 7,044
  • 3
  • 27
  • 46
0

It depends on which template you are trying to override and your theme.
But generally this will work.
Override page.tpl.php with "page--node--3.tpl.php".
Override html.tpl.php with "html--node--3.tpl.php".
Override node.tpl.php with "node--3.tpl.php"

There are all outlined at: Drupal 7 Template (Theme Hook) Suggestions

The posts you were reding may have been for Drupal 6 which did not need the double dash if I remember correctly.

You can create your own suggestions but I think the above will serve your purpose.

2pha
  • 9,798
  • 2
  • 29
  • 43