Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Hiding logo and navMain on homepage

Hiding logo and navMain on homepage

Locked

Views: 1,402

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
20 Jan 2009, 6:02 PM
#1
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Hiding logo and navMain on homepage

I've poured through this forum, and while I haven't found EXACTLY what I was looking for, I did find enough information to formulate my question.

1st a link: http://testsite.overthehillweb.com/zentest1/

I want to hide the logo and the navMain from the home page only. I used a stylesheet for the index page to do this, but the issue as you can guess is that I discovered that this not only affects the "home" page, but all of the other index pages as well (category pages etc..) http://testsite.overthehillweb.com/zentest1/index.php?main_page=index&cPath=1 So that idea is out the window..

So I'm back to where I started with hiding this on the "tpl_header.php". The thing is I tried hiding the entire header, but then my top inside rounded corners disappear.. I could live with this, but my cllient would rather not..

So can I simply wrap the logoWrapper and navMain divs with this:

<?php if (!$this_is_home_page) { >?
your HTML button code;
<?php } ?> 

I'm at work and can't try this out right now, so I thought I'd pose the question to see if I'm on the right track before I get home tonight.:cool: Hope one of the experts can chime in..

20 Jan 2009, 9:07 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Hiding logo and navMain on homepage

Depending upon what the resulting look is - have a look at the tpl_main_page.php and you can toggle the header off and add and if for $this_is_home_page....

Or you can create a dir in the custom template and I think this would be "home" or "index" and in that place your custom copies for the tpl_header.php and others

One of these should get what you need

20 Jan 2009, 10:30 PM
#3
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Hiding logo and navMain on homepage

kobra:

Depending upon what the resulting look is - have a look at the tpl_main_page.php and you can toggle the header off and add and if for $this_is_home_page....

Or you can create a dir in the custom template and I think this would be "home" or "index" and in that place your custom copies for the tpl_header.php and others

One of these should get what you needI actually started out this journey by turning off the header in the tpl_main_page.php file. It seemed to work.. Turned the header off, but th hidden header spoiled the rounded corners on the inside top part of the home page. So I decided to try not hiding the headerWrapper, but only hiding the elements within the headerWrapper (hence how I ended up creating the other stylesheet)

But the directory inside the template sounds intriguing. If I do this, will the changes to tpl_header.php affect only the home page (which is what I do want) and leave all the other index pages with the logo and menu intact..

21 Jan 2009, 2:47 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Hiding logo and navMain on homepage

But the directory inside the template sounds intriguing. If I do this, will the changes to tpl_header.php affect only the home page (which is what I do want) and leave all the other index pages with the logo and menu intact.
This is what I suspect would happen ...
I have not used it for the home page, hence why I am not sure of the dir name.
I have used this for other pages like: the checkout pages and have these additional dir's directly under the custom template
checkout
checkout_shipping
checkout_payment

Pulling the name from part of what is displayed in the browser like:
index.php?main_page=checkout&action=null

The main I am not sure of but there are many posts about coding it as "home" but the dir might have to be "index"

21 Jan 2009, 4:45 AM
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Hiding logo and navMain on homepage

kobra:

This is what I suspect would happen ...
I have not used it for the home page, hence why I am not sure of the dir name.
I have used this for other pages like: the checkout pages and have these additional dir's directly under the custom template
checkout
checkout_shipping
checkout_payment

Pulling the name from part of what is displayed in the browser like:
index.php?main_page=checkout&action=null

**The main I am not sure of but there are many posts about coding it as "home" but the dir might have to be "index"**Sounds like the directory solution will not solve my problem.. I'll give it a shot, but my guess is that the result will be the same as when I used the index_home.css. Since "index" is in the URL of not only the home page, but the category pages as well.. sigh

I have tried a ton of stuff, and it's like an ALL or NONE deal trying to gt this to work the way I'd like..:frusty: If I use the stylesheet option, it works PERFECT on the home page BUT (unfortunately) it also works on all of the category pages as well:censored:.. (not a desired effect)

The only thing I've gotten to work is adding the code to the tpl_main_page.php file.. However I lose the top part of my inside rounded corners..:censored: I don't know what to try next..

21 Jan 2009, 4:57 AM
#6
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Hiding logo and navMain on homepage

Okay there is one more thing I can try.. but I don't know the proper syntax to modify this.. I found this little snippet

if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {
 $flag_disable_right = true;
}

I know that this code disables the right column if the category ID = 3. I think I need to do something similar.. Just need to figure out how to modify this so that if there is NO category ID in the URL, any divs within the headerWrapper divs would not display.. This would still display the headerWrapper div (which means my inside top rounded border still works), but the logoWrapper & navMain divs will remain invisible on the main page.. sigh

21 Jan 2009, 9:31 PM
#7
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Hiding logo and navMain on homepage

Well after trying a BUNCH of stuff last night, I decided that's enough for me..:frusty:

I am going to seek some commercial assistance to see if I can get some traction on coming up with my desired solution before I go with just simply hiding the header.. I turned to a good friend who is totally proficient in PHP (unlike MOI:laugh:) and will only charge me a nominal fee to take a stab at coming up with a solution -- if he can't help then there's always "Renta-A-Coder":laugh: I actually don't mind paying someone to get the solution I want..

My friend got a kick outta my efforts to resolve this myself... When I turned to him for help he stated: "Hmmmm... so let me get this straight.. You're trying to program, and you're not a programmer..":laugh: What can I say.. I usually manage to figure these things out..:cool:

I appreciate your responses Kobra..:clap: I gave it a good old college try..