If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / CSS Dropdown menu for the header- With Categories!

CSS Dropdown menu for the header- With Categories!

Started by jettrue on 17 Feb 2007, 6:44 AM · Views: 618,977

Results 21 to 40 of 2,344
20 Feb 2007, 10:35 PM
#21
cmessa avatar

cmessa

New Zenner

Join Date:
Mar 2006
Posts:
29
Plugin Contributions:
0

Post #21 by cmessa

Thanks, that worked great. I appreciate the help!!

21 Feb 2007, 2:26 PM
#22
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Post #22 by dogtags

jettrue:

  1. Open up includes/templates/YOUR_TEMPLATE/common/tpl_drop_menu.php and remove the "class="submenu" from top-level items without sub items. So the contact us link would change to this:
<li><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CONTACT_US; ?></a></li>
  1. Add this to the header_menu css file:
    div#dropMenu li.submenu li.submenu {background: none;}

OR, you could use the image attached to have arrows pointing right to designate further subcategories, with this css:

div#dropMenu li.submenu li.submenu {background: url(../images/submenu.gif) 95% 50% no-repeat;}

Much better!

The only thing it doesn't seem to work with is the conditional menu items like the following:

      <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
        <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <ul class="level2">
          <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
        </ul>
        <?php }?>
      </li>

Even if there are no items in the cart, the down arrow still displays in the top Shopping Cart link.

Other than that, this menu is totally great

Thanks super much :smile:

21 Feb 2007, 11:03 PM
#24
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Post #24 by jettrue

DogTags:

Even if there are no items in the cart, the down arrow still displays in the top Shopping Cart link.

Other than that, this menu is totally great

Thanks super much :smile:

Okeedokee...

To fix this, we can just expand the conditionals so that if there are no items in the cart, they get the <li> and if there are items in the cart, they get the <li submenu

So, replace the whole shopping cart section with this:

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
      <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
        <ul class="level2">
          <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
        </ul>
      </li>
      <?php } else { ?>
      <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
      <?php } ?>

LMK how it works for ya!

22 Feb 2007, 7:45 AM
#25
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #25 by still_crazy

Hi.

Great contribution, just what I had been looking for.

2 small problems however; Displays great in Firefox but in ie the dropdowns go behind the sideboxes and the centre content.
Secondly, although i have them turned off, gift certificate and newsletter unsubscribe links still appear in the information drop down. [they do not appear in the css flyout menu or standard categories sidebox in the same install]

Has anyone else had these problems, and if so, how did you resolve them.

TIA

Crazy


22 Feb 2007, 1:34 PM
#26
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Post #26 by jettrue

Still Crazy:

Hi.

Great contribution, just what I had been looking for.

2 small problems however; Displays great in Firefox but in ie the dropdowns go behind the sideboxes and the centre content.
Secondly, although i have them turned off, gift certificate and newsletter unsubscribe links still appear in the information drop down. [they do not appear in the css flyout menu or standard categories sidebox in the same install]

Has anyone else had these problems, and if so, how did you resolve them.

TIA

Can I see a link please? I have tested this in IE, without the issues you mention.

I don't have the newsletter and gift certificate links coded to turn off automatically, however that's a good idea, I'll work on that. In the meantime, you can open up includes/templates/YOUR_TEMPLATE/common/tpl_drop menu.php and just erase the one you don't want to show up.

22 Feb 2007, 1:48 PM
#27
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #27 by still_crazy

Hi Jade, thanks for your response.

Will remove the unwanted links as you suggest.

Site is still very new [and raw] still playing around with ideas etc. but here is the url: https://www.rgdistribution.co.uk

Browser is IE V6 [Firefox is fine].

Thanks again

Crazy


22 Feb 2007, 3:14 PM
#28
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Post #28 by dogtags

jettrue:

Okeedokee...

To fix this, we can just expand the conditionals so that if there are no items in the cart, they get the <li> and if there are items in the cart, they get the <li submenu

So, replace the whole shopping cart section with this:

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
  <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
    <ul class="level2">
      <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
    </ul>
  </li>
  <?php } else { ?>
  <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
  <?php } ?>
> 
> LMK how it works for ya!

Yep, on the money, great! Thanks :smile:
23 Feb 2007, 9:18 PM
#29
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Post #29 by jettrue

Still Crazy:

Hi Jade, thanks for your response.

Will remove the unwanted links as you suggest.

Site is still very new [and raw] still playing around with ideas etc. but here is the url: https://www.rgdistribution.co.uk

Browser is IE V6 [Firefox is fine].

Thanks again

Hello there!

I'm not having the same issue in IE on my site with the same menu, the only big difference I see is that I've removed the tables surrounding the main content.

Try adding this to your stylesheet, and let me know if this works:

#contentMainWrapper {z-index:0;}

23 Feb 2007, 10:17 PM
#30
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #30 by still_crazy

Hi Jade

Removed the tables and added the z-index =0 to the stylesheet but having exactly the same problem.

I will try a re install and see if that works, strange that you do not have the same on your site!

Thanks for trying.

Regards

Crazy


23 Feb 2007, 11:01 PM
#31
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Post #31 by jettrue

Still Crazy:

Hi Jade

Removed the tables and added the z-index =0 to the stylesheet but having exactly the same problem.

I will try a re install and see if that works, strange that you do not have the same on your site!

Thanks for trying.

Regards

I'm sure its due to some other difference I didn't appreciate yet... don't think you should have to re-install...

Did we already discuss which version of zen cart you are using?

But lets check to make sure its the stylesheet.

Save a copy of your stylesheet somewhere, and in its place, upload my apple zen stylesheet, and see if the problem persists. Then we'll know for sure its something in the stylesheet.

I'm attaching a text file with my stylesheet. It would probably look REALLY crazy, but if you go to a product page you should be able to see if the menu is over or under. Here is the file:

24 Feb 2007, 10:54 PM
#32
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #32 by still_crazy

Hi

Ok, I have now tried your stylesheet and all works correctly. I will sift through my stylesheet tomorrow and find the culprit.

Many thanks for your help.

Regards

Crazy


24 Feb 2007, 11:04 PM
#33
birdoasis avatar

birdoasis

Inactive

Join Date:
Jun 2005
Location:
Cheney WA
Posts:
1,123
Plugin Contributions:
0

Post #33 by birdoasis

If you just use the dropdown menu without the category side box, will that hurt your pageranking?

Or should I put this as, how will the spiders like your site if the menu is in a dropdown box instead of in a side box for everyone to see?

John Patrick
A Zen Cart Advocate!

25 Feb 2007, 8:19 AM
#34
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #34 by still_crazy

I think by page ranking you probably mean SERPS, as page ranking is now less significant than it was a year or so ago.

You can safely turn off the categories list, the search engine spider will be able to crawl your pages via the drop down menu.

Crazy


25 Feb 2007, 1:46 PM
#35
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Post #35 by jettrue

birdoasis:

If you just use the dropdown menu without the category side box, will that hurt your pageranking?

Or should I put this as, how will the spiders like your site if the menu is in a dropdown box instead of in a side box for everyone to see?

Yep, still crazy is correct, if you look at the source of your site with the header dropdown menu, you are still getting real links like you would with a regular menu.

25 Feb 2007, 2:00 PM
#36
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #36 by still_crazy

Just to close this off, I have now solved my ie issue as detailed in message 24.

Couldn't find how I broke it, spent several hours trying to undo [mostly un comment] my mods to the original style sheet, but found a fix.

Added z-index:5; to the headerWrapper and appears to work correctly now.

Many thanks for your help.

Crazy


26 Feb 2007, 2:29 AM
#37
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Post #37 by jettrue

Still Crazy:

Just to close this off, I have now solved my ie issue as detailed in message 24.

Couldn't find how I broke it, spent several hours trying to undo [mostly un comment] my mods to the original style sheet, but found a fix.

Added z-index:5; to the headerWrapper and appears to work correctly now.

Many thanks for your help.

Glad to hear.

26 Feb 2007, 2:49 AM
#38
birdoasis avatar

birdoasis

Inactive

Join Date:
Jun 2005
Location:
Cheney WA
Posts:
1,123
Plugin Contributions:
0

Post #38 by birdoasis

SERPS?

Oh man, and I thought I had it down. Now I have to go learn about SERPS.

Sounds like some sort of refugee. haha.

Thank you!!!

John Patrick
A Zen Cart Advocate!

26 Feb 2007, 3:49 AM
#39
jtschrade avatar

jtschrade

New Zenner

Join Date:
Jan 2007
Posts:
5
Plugin Contributions:
0

Post #39 by jtschrade

Ok, have the module installed and I'm definitely a beginner when it comes to editing php and css files. I want to edit this so that the drop down menu is only showing the categories in my catalog (each category name showing horizontally across the top of the website and not showing any of the other stuff listed in the default settings). I'm not sure how to to do that. Any help would be great.

26 Feb 2007, 8:31 AM
#40
still_crazy avatar

still_crazy

New Zenner

Join Date:
Sep 2006
Location:
Derby UK
Posts:
97
Plugin Contributions:
0

Post #40 by still_crazy

birdoasis:

SERPS?

Oh man, and I thought I had it down. Now I have to go learn about SERPS.

Sounds like some sort of refugee. haha.

Thank you!!!

SERPS [or I suppose technically SERP's] = Search Engine Results Pages

Page Rank [PR] A system developed by Stanford University and Larry Page [co founder of Google] to enable every page on the internet to be assesed for importance. The importance being judged mainly by the quality of inbound links.

HTH.

Crazy