Zen Cart Logo

disabling NavMain

Locked

Views: 1,957

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
18 Feb 2010, 10:40 PM
#1
mzimmers avatar

mzimmers

Zen Follower

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

disabling NavMain

Hi -

I'd like to experiment with disabling NavMain from my site. (I realize I might rethink this later, but for now I want to do it.)

Is this done via a configuration setting from the admin section, or do I need to edit some code? If the latter, I'd appreciate being pointed to the right file.

Thanks!

18 Feb 2010, 10:57 PM
#2
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: disabling NavMain

The easiest way would be to find the #navMain selector in your css and add display:none to it. This will prevent it from displaying. :D

18 Feb 2010, 11:12 PM
#3
mzimmers avatar

mzimmers

Zen Follower

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

Re: disabling NavMain

Two questions:

  1. my stylesheet.css doesn't have a selector unique to #navMain. It has this:

#navMain ul, #navSupp ul, #navCatTabs ul {

Can I put a css definition unique to navMain just below this? (I believe that css files are read top to bottom, and so anything later would override or augment earlier settings, right?)
2. this is definitely easy (assuming the above would work), but is it the "zen way?" I have the impression that most modifications to ZC done via configuration, not changing code files.

Thanks.

18 Feb 2010, 11:16 PM
#4
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: disabling NavMain

  1. Yes, if there is no selector already, you can add it. There is also a selector for #navMainWrapper I believe, so you might try to see which one works best for you. My site is heavily customized, so I can't tell you exactly what to do without a url to your site.

  2. I do not believe there is any admin control for the main navigation.

:D

18 Feb 2010, 11:23 PM
#5
mzimmers avatar

mzimmers

Zen Follower

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

Re: disabling NavMain

I'm still feeling my way through css here. I believe that the line I posted above applies only to ul items, right? So, there's nothing JUST for the navMain element itself.

Should I put my new code before the code that I listed? That seems to be the way its done in other stylesheets I've looked at.

The navMainWrapper element is similarly "bundled" in with other items I don't wish to hide, so I can't just add it there.

Thanks for the help.

18 Feb 2010, 11:26 PM
#6
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: disabling NavMain

You are correct. The line you posted above pertains only to ul items for #navMain, #navSupp, and#navCatTabs.

I would add the new code before those as well. It's how I do it but mostly for sanity and organization. :D

You can add the navMainWrapper with the new code it if you want it hidden as well.

So you could add:

#navMainWrapper, #navMain {
display:none;
}

18 Feb 2010, 11:30 PM
#7
mzimmers avatar

mzimmers

Zen Follower

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

Re: disabling NavMain

Thanks so much! Now (and this is mostly for my education only)...what if I wanted to move it below the banner instead of eliminating it?

18 Feb 2010, 11:37 PM
#8
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: disabling NavMain

That would be done in includes/common/tpl_header.php...there are blocks of code labeled with comments such as

<!--bof-navigation display-->

code is here...

<!--eof-navigation display--> <!--bof-branding display-->

code is here...

<!--eof-branding display-->

so you would cut the block of code for the navigation, and paste it under the block of code for the header logo...

18 Feb 2010, 11:42 PM
#9
mzimmers avatar

mzimmers

Zen Follower

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

Re: disabling NavMain

Ah, OK, so it's another file-level change (which is perfectly fine...I'm just still trying to get the lay of the land here).

And, what does the "f" stand for in "bof" and "eof?"

Thanks.

18 Feb 2010, 11:51 PM
#10
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: disabling NavMain

It definitely takes a while to learn the system and where everything is...before you make any php file changes though, make sure you have a good grasp on the override system and that you are using your own custom template. Otherwise you will have major headaches later down the road, especially when upgrading.

I've always just assumed the bof and eof just meant beginning of and end of. :)

18 Feb 2010, 11:58 PM
#11
mzimmers avatar

mzimmers

Zen Follower

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

Re: disabling NavMain

Yeah, I'm familiar with the concept of having a private area for making changes that override the system default code. The twist in ZC is that there isn't a single area under which all of my private stuff is contained; rather, it's in multiple areas: languages, modules and templates, to name a few. That is taking some getting used to.

Thanks for the help with this. I'm sure I'll be back asking other questions very soon.