Custom Home Page


Author Message
fwright

Posted: 6/22/2009
Quote message 

I like Artisteer, but was having trouble trying to accomplish something that is simple in another themes (a custom home page). I Found an interesting way to make a custom home page without hacking on the page.tpl.php files in Artisteer (which is a chore given how Artisteer sets up these template files in Drupal).

1. Let's say you want a home page that has no menu, or no header or both, but you want to leave the rest of the site with a menu, header, etc. I discovered that you can open up your theme file in Artisteer. Make the adjustments you wish (remove the menus, the header, etc.) and then export the theme. Take out the page.tpl.php file and rename it page-front.tpl.php. Put this file into your original theme file. What you will see is that your customizations apply only to the home page, and the rest of the site remains intact. Very useful. Note, this only works for some elements such as the header, the menus, etc. It won't work for things like typeography, fonts, etc. For that, I have another solution....

2. Let's say you want to remove the title on your custom home page (something you can't do with my method above). Download the Drupal module called CSS Injector. With CSS Injector, you can customize just about any CSS element on you site and you can specify which page you want it to apply to (great for making a custom home page in Artisteer without hacking up your style.css file or messing with the template.php files).
 
kevin

Posted: 3/23/2010
Quote message 

Another way that I have found very helpful for editing some of the aspects of the front page as opposed to the rest of the site, especially for the background images which are usually included in the body class of the style.css is to use the body_classes variable.

For instance:

In page.tpl.php,
replace: <body>
with: <body class="<?php print $body_classes; ?>">

Then in style.css, you can define a body.front class with separate .css attributes such as:

body.front {
background-image: url('images/background2.png');
}

(placing this underneath the body css attributes)
 
lostchord

Posted: 3/23/2010
Quote message 

You can also configure the block - Primary Links for the Menu - to not be displayed on page <front>. This is done in the standard Block configuration menu.

Cheers.
 
ChrisA

Posted: 3/25/2010
Quote message 

An even easier way is with the panels module, plus you can alter it easily or even have a number of different front pages you can instate as the mood takes you.

http://drupal.org/project/panels