Jump to content


Different front page


  • You cannot reply to this topic
3 replies to this topic

#1 mmjaeger

    Likes Etomite Forums!

  • Member
  • PipPip
  • 343 posts

Posted 20 August 2004 - 04:35 PM

Hello,

I'd like to achieve the following:

having a different front page without creating two different demplates.

the only difference between the front page and all the other pages is that I want to show a large header image on the front page but not on all the other pages.

could this somehow be done with the document id or how could this be achieved.

thank you

#2 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 20 August 2004 - 04:56 PM

Yes, this could be done several different ways depending on what you are displaying and how you would like to go about this task... My recommendation would be to create a TopImage snippet that would use one image for the ID of your front page and then display a different image for any other page, using a conditional "if" clause... Something like:

if(id == 0) {  # ID of your sites front page

  $img = "frontpage_top.png";

}

else {

  $img = "site_top.png";

}

return $img;

You could use [[TopImage]] in place of your image name within the site template... Not tested, but should work...

#3 Guest_Alex_*

  • Guests

Posted 20 August 2004 - 05:58 PM

This would work as well:

if($etomite->documentIdentifier==$etomite->config['site_start']) {  

  return "<img src='frontpage_top.png' />";

} else {

  return false;

}

This will show an image if the ID is the ID you've put in the 'site start' setting in Etomite Configuration, or else won't show anything at all ;)

If you want to show more than just an image, you could put your header in a chunk (call it LargeHeader), and then do this:

if($etomite->documentIdentifier==$etomite->config['site_start']) {  

  return $etomite->getChunk('LargeHeader');

} else {

  return false;

}


#4 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 20 August 2004 - 08:21 PM

I wasn't sure if an image was required for the rest of the site or not, which is why I had opted for the one or the other scenario... Just goes to show that there is a lot of flexibility when working with Etomite... What a beautiful thing... :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users