-1

I want to have two page.tpl.php on my site ..one for my front page and other for rest of pages ...now both have same name page.tpl.php what should I do to make one of them for Front page and other for rest of pages

0

1 Answer 1

5

To implement two templates files into a site.

By default, page.tpl.php already exists in a drupal theme.

Creating a front page template is rather simple. In your theme folder (sites/all/themes/), copy the page.tpl.php file from drupal core(e.g. garland) or your parent theme. Then rename it accordingly (see below). You probably won't see the results until you clear your cache; so make sure to do that.

page--front.tpl.php(drupal 7)

To do a custom front page that is mostly unique, yet merges seamlessly with Drupal, you can:

  1. Create a file called page--front.tpl.php in your active theme directory.
  2. Paste in solid, static HTML, with appropriate file path fixes.
  3. Compare your page with the themes normal page.tpl.php and copy as much of the code tags as is logical into your new file in appropriate places.
  4. You can put $content in the middle, sidebars in a useful place for you to call blocks into later, and the $footer in your footer zone, etc. Try to copy as much as possible - most of it can be useful, and is the real reason for using a CMS.

For more information regarding template files Click Here

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