I have been pulling my hair out trying to get my front page to look like I want it to. I have tried the Front Page module and the Dashboard module without success. I am now looking at formatting the front page within the template directly instead of relying on third party modules. Is this a logical plan of attack?

I propose to populate the various areas with PHP snippets etc so I have complete control on what goes where. I will probably use some of the function from the Dashboard module to do some of what I want. If I do it this way (directly in the theme), what becomes of the front page setting in Drupal? Does that become redundant?

Any help would be appreciated. I was supposed to launch a few days ago and here I am still struggling to get things working.

Comments

dublin drupaller’s picture

Hi Dally..

the front_page.module is handy for what you want to do..but it sounds like you have already tried that.

if you are using a phptemplate based theme..can I recommend the following handbook page in the php template snippets section?

In particular, the front page layout switcher snippet which is linked at the bottom of that page.

Hope that helps..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

DallyBoy’s picture

Thanks Dub

Yup, I did try the front_page module but it seems to have changed since last I looked at it. Now it seems we have to put in 2 lots of code/design - one for anon and one for reg - and that is something I don't want to do. I may not be understanding the use of it but I can't find any indepth docos.

I have been trawling through the snippets looking for what I need (and adjusting some to suite) so hopefully today I will make some progress.

What annoys me is I could have had a Joomla site up and running weeks ago, but I hate Joomla! - so I stuck with Drupal. I know all the pain will be worth it in the end...(I hope!)

Cheers

dublin drupaller’s picture

Hi dally..

I maintain the front_page.module...there is a detailed readme.txt that comes with the module that might help.

otherwise, just post a question up here and I'll do my best to asnwer.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

DallyBoy’s picture

HI again Dub

I just realised that you maintain the front_page module, then I see you tell me in your answer. Lucky I didn't say something nasty about it! J/K!

My biggest "issue" was that I thought I needed to create the same page for both anon & reg but after looking at older versions in CVS, I came across a note that explained the "Same" setting. After that I actually read the help text in the settings page and saw the information there. Could I suggest you put the "same" info into the readme, it doesn't appear there at the moment. This would be for old buggers like me who have trouble readin the screen! :)

Cheers

boris mann’s picture

It's pretty simple to do an if $is_front ( include front.tpl.php ) and do whatever you want in that file.

DallyBoy’s picture

Thanks Boris, I never thought of that. My try that route too...

I assume that the check for $is_front would be aroudn the area of the $content variable? (I am using the phptemplate engine)...

Cheers

boris mann’s picture

It's PHP, use it wherever you need it...you could switch out the entire design of the entire site and have a completely separate front. So, could even be if ($is_front) (include front.tpl.php) else (include inside.tpl.php).

DallyBoy’s picture

Thanks again Boris

I think I would just stick with the content side of things before I start playing with the whole page. But it is good to know what can be done, I am learning something new every day!

Cheers

dublin drupaller’s picture

there's an example of using the $is_front statement at the following...

if you are using a phptemplate based theme..can I recommend the following handbook page in the php template snippets section?

In particular, the front page layout switcher snippet which is linked at the bottom of that page.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

DallyBoy’s picture

Thank you Sir! I'll take a look at that...

thinkinkless’s picture

just in case you haven't resolved this yet - here's the method we use on www.fresnofamous.com for the custom homepage.

before the doctype in page.tpl.php

<?php
if ($is_front) {
  include('home.tpl.php');
  return;
} 
elseif (arg(0)=="admin") {
  include('adminonly.tpl.php');
  return;
}?>

home.tpl.php was built with the same base as page.tpl.php, but we call in homepage only css, snippets and blocks.
adminonly.tpl.php is pure vanilla - no header, right sidebars or blocks. it'll help load time and also saves server resources when you are in admin mode.

btribble’s picture

I've run into a strange behavior when I use the front_page module.

It's installed and works great, except that when I try to access my site by using http://mysite.com it hangs, won't load. If I use http://www.mysite.com it works fine.

If I disable front_page or change the >>default homepage back to 'home' in >>settings, everything works with or without the www.

What would be causing this?