Pretty straight forward question:
I have page--front.tpl and page.tpl template pages in use in a drupal 7 site. However, I'd like to use page-front.tpl on one other page. Is this possible or do I need to create another .tpl page to do this.
The site I'm working on is split into two sections, it's essentially two seperate websites that you can flip between whether your a consumer or business owner. So I want to use the front.tpl template for the home page of each site.
Cheers.
You can add
theme_preprocess_page
function to your theme'stemplate.php
file and then add your template name in templates suggestions list.EDIT
If you want to specify template name by path alias, you could write code like this:
Without this function you would have the following node template suggestions by default:
And this function would apply to your node the following new template suggestions. Example node with
node/1
path andpage/about
alias:So after that you can use
page--page-about.tpl.php
for your page.If you want to apply
page--front.tpl.php
to your let's saynode/15
, then in this function you can add if statement.This would give you the following template suggestions:
The highest index - the highest template priority.