1
votes

I'm very new on Drupal 7, I've been trying to customize my home page by adding my own html on page.tpl.php, which works fine but my problem is that the what I add on the home page appears on all the other pages as well and I don't want that. Can anyone tell me is the anther instead of page.tpl.php where I can put my html code so it show only on the home page or is there code I can insert so my html appears only on the home page?

please help, and please give a step by step solution as I'm a noob when it come to Drupal.

thank you in advance...........

4

4 Answers

5
votes

The Template file must be named as

page-front.tpl.php(Drupal 6)
page--front.tpl.php(Drupal 7)

This only affects the front page of the site.

0
votes

You can use the template files

page-front.tpl.php (Drupal 6)

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

Put page-front.tpl.php (Drupal 6) OR page--front.tpl.php (Drupal 7) in your themes folder (/sites/all/themes/your_theme), and then clear the site chache here:

http://yoursite.com/admin/config/development/performance (Drupal 7)

http://yoursite.com/admin/settings/performance (Drupal 6)

Your templates will work.

0
votes

You can use panels to quickly customize the page. And you can specify any page as front page in Drupal. Go to Configure > site information and set the front page. Panels gives you flexibility in building the layout & adding content on it. Its the quickest way to build a custom page in Drupal

0
votes

There is variable available in page.tpl.php that return true if you are in front page : $is_front, you can check that before you add your htmls