Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Disable Header for all but first page

Disable Header for all but first page

Locked

Views: 2,135

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
2 Sep 2006, 4:43 PM
#1
michaelvincent avatar

michaelvincent

New Zenner

Join Date:
Sep 2006
Posts:
8
Plugin Contributions:
0

Disable Header for all but first page

Hey guys, I've been hacking away at zen cart for a few weeks now for a site I'm working on, and so far so good. These forums have been a great help and so far I've been quite pleased with my progress. I have one thing that is confusing me at the moment though...

The page is at: http://www.lheritagearts.com/gallery/

I want to disable the header for every page except for the first page of the gallery. The person I am working on this for felt (rightfully so) that having the header and intro text on every page sort of redundant and that it would be better for the user to not have to scroll through it every time. So far I have been partially successful at getting what I want by using this flag to disable the headers:

<?
if ($current_page_base == 'index' and $cPath >= '67') {
 $flag_disable_header = true;
}
?>

This seems to knock out the header everywhere I need it to except for when you go to an individual entries (for example: http://www.lheritagearts.com/gallery/index.php?main_page=product_info&cPath=67_89&products_id=191%29. So I figure I'm just missing something really simple here, any help would be much appreciated!

2 Sep 2006, 5:14 PM
#2
michaelvincent avatar

michaelvincent

New Zenner

Join Date:
Sep 2006
Posts:
8
Plugin Contributions:
0

Re: Disable Header for all but first page

Oh yeah, the page where i added to code to disable the headers was in tpl_main_page.php.

Sorry for not mentioning that before.

2 Sep 2006, 8:19 PM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Disable Header for all but first page

You're in the right place and going about it in broadly the right way, but can you just clarify, do you, or do you not want the header on non-product pages such as contact us, privacy, checkout, shopping cart? I could infer either from the site's current state and your original post.

P.S. Very nice looking site.

2 Sep 2006, 8:32 PM
#4
michaelvincent avatar

michaelvincent

New Zenner

Join Date:
Sep 2006
Posts:
8
Plugin Contributions:
0

Re: Disable Header for all but first page

I only want to see the header when you go to lheritagearts.com/gallery, and nowhere else in the gallery. The client only wants to see it once and not on any subsequent pages because they feel it is redundant.

PS: Thanks! I'm definitely a designer first and a coder second

2 Sep 2006, 9:43 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Disable Header for all but first page

I'd go for > <?

if (($current_page_base == 'index' and (int)$cPath >0) or $current_page_base !='index') {

$flag_disable_header = true;

}
?>The differences are that I have excluded all category pages (which are built from the index file, rather than just those categories with IDs greater than 67 (which works for you due to an anomoly in your data), and have then gone on to also exclude all other pages, such as the ones I listed earlier.

2 Sep 2006, 10:24 PM
#6
michaelvincent avatar

michaelvincent

New Zenner

Join Date:
Sep 2006
Posts:
8
Plugin Contributions:
0

Re: Disable Header for all but first page

Thanks for your help!

I'll give that a shot later today when I'm around my work computer again.

Here's hoping that does the trick! Thanks again for the quick reply!