Zen Cart Logo
Forums / All Other Contributions/Addons / CSS Dropdown menu for the header- With Categories!

CSS Dropdown menu for the header- With Categories!

Views: 615,557

Results 1,721 to 1,740 of 2,344
18 Dec 2009, 1:15 AM
#1721
mskala23 avatar

mskala23

New Zenner

Join Date:
Dec 2009
Posts:
44
Plugin Contributions:
0

CSS Dropdown menu for the header- With Categories!

Can I do this on the footer and have the options pop up? Or can I move the header down the page. I would like to have these links be on the bottom of the pages to match my existing website.

18 Dec 2009, 12:59 PM
#1722
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

timdwyer42:

<?php class zen_categories_ul_generator { var $root_category_id = 0, $max_level = 0, $data = array(), $root_start_string = '', $root_end_string = '', $parent_start_string = '', $parent_end_string = '', $parent_group_start_string = '<ul%s>', $parent_group_end_string = '</ul>', $child_start_string = '<li%s>', $child_end_string = '</li>', $spacer_string = ' ', $spacer_multiplier = 1; var $document_types_list = ' (3) ';// acceptable format example: ' (3, 4, 9, 22, 18) ' function zen_categories_ul_generator($load_from_database = true) { global $languages_id, $db; $this->data = array(); $categories_query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.categories_status=1 " . " and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' " . " order by c.parent_id, c.sort_order, cd.categories_name"; $categories = $db->Execute($categories_query); while (!$categories->EOF) { $this->data[$categories->fields['parent_id']][$categories->fields['categories_id']] = array('name' => $categories->fields['categories_name'], 'count' => 0); $categories->MoveNext(); } } function buildBranch($parent_id, $level = 1, $submenu=false, $parent_link='') { if ($parent_id != '0') { $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level) . '"' : '' ); } if (($this->data[$parent_id])) { foreach($this->data[$parent_id] as $category_id => $category) { $category_link = $parent_link . $category_id; if (($this->data[$category_id])) { $result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' : ''); } else { if (($this->data[$category_id]) && ($submenu==false)) { $result .= sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : ''); $result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' : ''); } else { $result .= sprintf($this->child_start_string, ''); } } if ($level == 0) { $result .= $this->root_start_string; } $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * level1) . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">'; $result .= $category['name']; $result .= '</a>'; if ($level == 0) { $result .= $this->root_end_string; } if (($this->data[$category_id])) { $result .= $this->parent_end_string; } if (($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) { $result .= $this->buildBranch($category_id, $level+1, $submenu, $category_link . '_'); } $result .= $this->child_end_string; } } if ($level > 0) { $result .= $this->parent_group_end_string; } return $result; } function buildTree($submenu=false) { return $this->buildBranch($this->root_category_id, '', $submenu); } } ?>
> 
> 
> The one thing about the code change is that the link to your subcats from the menu does not dispay the full category path. Just the final subcat and product id which means the normal categories sidebox menu doesn't open. I imagine the code could be changed to get it to open the full path but I havn't figured out how.

I added few things to display the full path on sidebox menu.
it seems to work fine to me but not sure if there is an invisable bug. use it for your own risk.
19 Dec 2009, 3:12 PM
#1723
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

doesn't work on my website...when I upload the tpl_header via ftp it stops working
what's the matter?
thanks

20 Dec 2009, 7:31 AM
#1724
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

what should i change on the CSS if i want to center the text on the top level and shift all text to the left on all sublevel.

Thanks in advance!

21 Dec 2009, 11:02 PM
#1725
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Can some1 answer me this:
i recently installed the css flyout menu 1.5 and the categories ul generator is being used now by a css click-show-hide sidebox from here:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=872

and now the categories are generated only in the sidebox and not the menu.how can i have them generate in both?:blush:

22 Dec 2009, 1:00 PM
#1726
slitter avatar

slitter

New Zenner

Join Date:
Jun 2005
Posts:
39
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Hi, I have a multiple language site and in one of my languages (dutch) i'd like to add a separate link in the dropdown menu.
I've read in an earlier thread that I can add this line: <li><a href="link_here">Link Name Here</a></li>
to my dropdown menu but how can i only show that link in that particular language and exclude it from all the others?
Is there an exeption i can use or do i need to make somekind of language_stylesheet.css to exclude this link from all other languages?
Your help would be greatly appreciated...

22 Dec 2009, 2:51 PM
#1727
sumitmalhotra avatar

sumitmalhotra

New Zenner

Join Date:
Dec 2009
Posts:
1
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Hi,

I successfully implemented the menu and its been working great (i am using 1.3.8 fresh install). I was wondering if there is a way to call EZPAGES into the menu with menu options that generate automatically through the Chapter / TOC relationship.

Read that this was done for 1.3.7, however how does it work in 1.3.8

Thanks and regards,
Sumit

24 Dec 2009, 6:12 AM
#1728
charinlasvegas avatar

charinlasvegas

Zen Follower

Join Date:
Jan 2009
Location:
Vegas Baby!
Posts:
311
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

I've read through this entire thread twice & I can't find a fix for my problem. I've got this installed on a test site. It works great but I have a huge space above the menu. I'm not sure what to edit in the stylesheet to fix this, I've tried a couple of things mentioned throughout the thread as possibilities but nothing seems to affect it. I don't know where the space is coming from, I have the menu on another site & it's not happening there.

This is the test site

I need the menu up higher to touch the bottom edge of the blue header.

25 Dec 2009, 12:38 AM
#1729
charinlasvegas avatar

charinlasvegas

Zen Follower

Join Date:
Jan 2009
Location:
Vegas Baby!
Posts:
311
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Anyone got a clue at all? I've been messing with this for 2 days now, nothing I do seems to affect the vertical position :frusty:

25 Dec 2009, 12:11 PM
#1730
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Can some1 answer me this:
i recently installed the css flyout menu 1.5 and the categories ul generator is being used now by a css click-show-hide sidebox from here:
http://www.zen-cart.com/index.php?ma...roducts_id=872

and now the categories are generated only in the sidebox and not the menu.how can i have them generate in both?:blush:

26 Dec 2009, 5:24 AM
#1731
charinlasvegas avatar

charinlasvegas

Zen Follower

Join Date:
Jan 2009
Location:
Vegas Baby!
Posts:
311
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Ok, finally have got this positioned correctly. NOW, there seems to be an issue as far when you hover over a submenu link, disappears too quickly & it's** very** difficult to actually click on the link to get where you want to go. Is there some kind of adjustment than can be made for that?

26 Dec 2009, 10:36 PM
#1732
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

anyone?!:unsure:

29 Dec 2009, 6:32 PM
#1733
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

:frusty:

29 Dec 2009, 11:04 PM
#1734
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Installed it with some great works ;) ... but now I have an issue!
I mean I don't want to have a rectangular "one color" shape, I was thinking to have something rounded. Is it possible? What should I do?
My website is https://www.alepia.ch and this module is up in the header ;) !

Thank you for you help!

31 Dec 2009, 8:59 PM
#1735
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

any help??

2 Jan 2010, 9:42 AM
#1736
pritchb avatar

pritchb

New Zenner

Join Date:
Dec 2009
Posts:
16
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

I added this mod and it works great but something strange also happened.

A new logo appeared above the fly-out menu (NewToolsyYou.com in funny block text.) I did not create this and don't know how to get rid of it.

Also the alignment of the header nav bar got screwed up. (Maybe the new unwanted logo pushed it over)

Here is my store URL http://newtools4you.com/index.php?main_page=index

Can someone help me fix this?

Thanks

2 Jan 2010, 11:52 AM
#1737
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Check the tpl_header file... most probably the problem is there.
I mean you have to modify the tpl_header file to not show the logo.

;)

p.s. tpl_header is in /includes/templates/YOUR_TEMPLATE/common/
where YOUR_TEMPLATE is your template name

2 Jan 2010, 12:56 PM
#1738
pritchb avatar

pritchb

New Zenner

Join Date:
Dec 2009
Posts:
16
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Here is my tpl_header.php file. I can't see anything in here about the logo

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 * @version $Id: tpl_header.php 3392 2006-04-08 15:17:37Z birdbrain $
 */
?>
<?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) {
?>
<div id="headerWrapper">
  <!--bof-navigation display-->
  <div id="navMainWrapper">
    <div id="navMain">
      <div id="navMainLinks">
        <ul class="back">
          <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
          <?php if ($_SESSION['customer_id']) { ?>
          <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
          <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
          <?php
      } else {
        if (STORE_STATUS == '0') {
?>
          <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
          <?php } } ?>
          <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
          <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
          <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
          <?php }?>
        </ul>
      </div>
      <div id="navMainSearch">
        <?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?>
      </div>
    </div>
  </div>
  <div class="clearBoth"></div>
  <!--eof-navigation display-->
  <!--bof-branding display-->
  <div id="logoWrapperOuter">
    <div id="logoWrapper">
      <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT, HEADER_LOGO_WIDTH, HEADER_LOGO_HEIGHT) . '</a>'; ?></div>
      <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
      <div id="taglineWrapper">
        <?php
              if (HEADER_SALES_TEXT != '') {
?>
        <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
        <?php
              }
?>
        <?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
        <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
        <?php
                }
              }
?>
      </div>
      <?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
    </div>
  </div>
</div>
<div class="clearBoth"></div>
<!--eof-branding display-->
<!--eof-header logo and navigation display-->
<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->
<!--bof-drop down menu display-->
<?php require($template->get_template_dir('tpl_drop_menu.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_drop_menu.php');?>
<!--eof-drop down menu display-->
<div class="clearBoth"></div>
<?php } ?>

The only place I see a reference to the logo is in a comment.

2 Jan 2010, 7:22 PM
#1739
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

If you don't want or need a logo, open includes/templates/template_default/common/ tpl_header.php find and comment out this line of code by adding
“<!--” at the beginning, “-->” at the end
and “//” between the words php and echo, as shown below.

<!-- <div id="logo"> <?php // echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?> </div> -->

Save the file to includes/templates/CUSTOM/common/ tpl_header.php and upload it to your server.

(remember to do a backup ;) )

2 Jan 2010, 8:13 PM
#1740
bexley avatar

bexley

New Zenner

Join Date:
Dec 2009
Location:
Perth Western Australia
Posts:
47
Plugin Contributions:
0

Re: CSS Dropdown menu for the header- With Categories!

Hi Can anybody tell me how to change the color from green to blue when hover over the menu bar top level menu.
I have tried stylesheet_header_menu.css and all I can do is change the green to blue on the second layer.
Any help most appreciated.
Steve - From a land down under