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!
Asked
Active
Viewed 239 times
0
-
Have-you trash your cache ? – Ôrel Feb 25 '15 at 14:35
-
Yep, cache has been cleared multiple times. Any other recs? – JordanBarber Feb 25 '15 at 14:43
3 Answers
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
-
Thanks for the response. When I do this process, my page simply spits out your above code in text format. – JordanBarber Feb 25 '15 at 19:21
-
Actually, I lied. I am getting the following....'Call-time pass-by-reference has been removed'. Any ideas? – JordanBarber Feb 25 '15 at 19:35
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