Hi there,

I am following the code from the handbook:

front page layout switcher for your page.tpl.php file

that should let me build a seperate home page look (I want to use icons only on the front page, as it is a site for school children - so iconf for forum, icon for news etc).

The code:


/**
* This snippet tells Drupal to load up a different page-front.tpl.php layout
* file automatically. For use in a page.tpl.php file.
*
* This works with Drupal 4.5,  Drupal 4.6 and Drupal 4.7
*/

if ($is_front) {
  include('page-front.tpl.php');
  return;
}

/**
* This snippet MUST go at the very top of your page.tpl.php file.
* the rest of your page.tpl.php in entirety should follow this snippet.
*/

Returns this error:

Fatal error: Allowed memory size of 44040192 bytes exhausted (tried to allocate 11520 bytes) in **************/drupal/themes/testTheme/page-front.tpl.php on line 48

I have tried upping the memory limit on the settings.php page, but no use.

Any ideas?

Cheers

Comments

ax’s picture

... an infinite recursion? ie. page-front.tpl.php includes page-front.tpl.php includes page-front.tpl.php ... the snippet code looks a little suspect to me. you might also try include_once instead of include.

hope that helps.

berty_boy’s picture

Doh!

Thanks for the help, it was a recursive problem.

Cheers

berty_boy’s picture

Ok,

Now ive used this

function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'page':
      global $user;
      if ($vars['is_front']) {
        $vars['template_file'] = 'page-front';
      }
      break;
  }

  return $vars;
}

in order to redirect to the homepage, however the css is not linking to the images correctly.

The CSS asks for images/headerBG.gif for example, where headerBG.gif is stored in an images folder - but zilcho.

Is this to do with the base href? I trawled the forums and found somebody offering this advice:

print base_path(). $directory; " />

Which I added to the page-front.tpl.php page.

This had the effect of removing all the css in IE and no difference in Firefox.

Anyone have any ideas?

Cheers

James

berty_boy’s picture

base href=" print base_path(). $directory; "