Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Different header/footer on home page only.

Different header/footer on home page only.

Views: 13,271

Results 21 to 32 of 32
18 Feb 2009, 7:22 AM
#21
jhouse avatar

jhouse

Zen Follower

Join Date:
Dec 2006
Posts:
132
Plugin Contributions:
0

Different header/footer on home page only.

Here you go:

http://www.tastyglutenfreebakery.com/

Thanks for the quick feedback.

Take care.

18 Feb 2009, 7:36 AM
#22
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Different header/footer on home page only.

hmmm.. confusing links on site..took fair time to find actual products..also site using html links not standard zencart..
not sure what you request is now possible..
:dontgetit

18 Feb 2009, 9:29 AM
#23
jhouse avatar

jhouse

Zen Follower

Join Date:
Dec 2006
Posts:
132
Plugin Contributions:
0

Re: Different header/footer on home page only.

Yeah, I only have two products listed at the moment, that's why you're seeing mostly empty categories. As far as the links go, I'm using Ultimate SEO urls, which produces .html extensions.

What about specifying the category number in the if/then statement, something like:

<?php if ($this_is_category=9) { include('muffins.php'); } else { include('top2.php'); } ?>I'm sure my code isn't correct, but I think you see what I'm thinking.

Thanks.

18 Feb 2009, 10:15 AM
#24
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Different header/footer on home page only.

Easiest way is to create different/new/extra stylesheet i.e.
c_9.css
where 9 is category you wish to have different
settings for colours, logo etc

24 Feb 2009, 3:05 PM
#25
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

Re: Different header/footer on home page only.

Could somebody please explain how I would load a different header for one particular page?

24 Feb 2009, 3:13 PM
#26
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Different header/footer on home page only.

swamyg1:

Could somebody please explain how I would load a different header for one particular page?
Which page..makes a difference on how to code.

24 Feb 2009, 3:19 PM
#27
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

Re: Different header/footer on home page only.

Hi Misty,

It's actually for my wordpress install on Zencart. I want to load a different header with all of my wordpress pages located in the "/blog" directory. Is it possible?

24 Feb 2009, 3:21 PM
#28
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Different header/footer on home page only.

probably possible but not tried it myself so cannot verify...

24 Feb 2009, 3:59 PM
#29
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

Re: Different header/footer on home page only.

misty:

probably possible but not tried it myself so cannot verify...

Any idea of the code I might use to try for a different header in this directory?

19 Mar 2009, 4:25 PM
#30
visua avatar

visua

New Zenner

Join Date:
May 2008
Posts:
18
Plugin Contributions:
0

Re: Different header/footer on home page only.

I tried using the php if/else statement, but it has broken my site.

Ive copied all the php and markup following :

<?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?>

that line, into two seperate files, top_home.php, and normal_top.php, they are located in /common/ directory.

This has broken my site completely, it only loads a background image :)

Is there something I am missing here? my tpl_header.php looks like the following:

<?php //omitted comments ?> <?php // Display all header alerts via messageStack: if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) { echo htmlspecialchars(urldecode($_GET['error_message'])); } if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) { echo htmlspecialchars($_GET['info_message']); } else { } ?> <!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <?php if($this_is_home_page) { include('home_top.php'); } else{ include('normal_top.php'); } ?>
15 Mar 2010, 4:52 PM
#31
bb3g avatar

bb3g

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: Different header/footer on home page only.

How about displaying header1 and header2 in main page and displaying only header1 on other pages? I have post a query in a separate thread but there's still no reply. :) Sorry for hi jacking this thread.

14 Jun 2011, 9:03 PM
#32
tamalita avatar

tamalita

New Zenner

Join Date:
Jan 2006
Posts:
57
Plugin Contributions:
0

Re: Different header/footer on home page only.

misty:

top_main.php
is shown on home page only and contains
your flash code
top2.php
is shown on all other pages and contains
normal header code i.e. non flash
add code coloured red to
/includes/templates/namofyourcurrenttemplate/common/ tpl_header.php
as follows

<?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?>

<?php if ($this_is_home_page) { include('top_main.php'); } else { include('top2.php'); } ?>


excellent! thank you!