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,701 to 1,720 of 2,344
21 Nov 2009, 3:39 PM
#1701
charinlasvegas avatar

charinlasvegas

Zen Follower

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

CSS Dropdown menu for the header- With Categories!

Finally got this working, now I just have a styling issue. It looks fine in FF, but in IE I've got this funky line showing above the menu that I can't seem to get rid of.

see here

I've tried everything I can think of to eliminate it, but no luck.

21 Nov 2009, 6:59 PM
#1702
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 spoke too soon, my site completely breaks apart now when something is added to the cart & the menu just goes nutz. No error log is generated, so I don't even know where to begin to look for what's causing this.

:censored:

23 Nov 2009, 3:33 PM
#1703
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

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

kburner:

Does anyone know code and file to put disable menu on pages like login, shopping cart, etc?

I have sideboxes disabled with includes/temp/xxx/templates/common/tpl_main_pge.php with this code:

//add page names that you want to disable left and right columns
$center_column_only = array('login','account','no_account','checkout','create_account', 'shopping_cart');
// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,$center_column_only) ) {
$flag_disable_right = true;
$flag_disable_left = true;
}

I figure it has to be similar....

I am still struggling with getting drop down menu NOT to display at login, shopping cart and checkout.

I am not good with code at All. Would code go in common/tpl_main_page.php or common/tpl_header.php?

It must go something like this? (this is for hiding sideboxes)

$center_column_only = array('login','account','no_account','checkout','create_account', 'shopping_cart');
if (in_array($current_page_base,$center_column_only) ) {
$flag_disable = true;
}

Help!:frusty::frusty:

24 Nov 2009, 12:46 AM
#1704
slappadudle avatar

slappadudle

New Zenner

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

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

Hi all.

Wow this is a long support thread! Not sure if this has already been addressed but here goes...

Using a PHP IF statement (I suppose), can I add an extra class name dynamically to the CURRENT pages' menu item so I can individually style it accordingly? Eg. different text color.

This would be a handy feature to include in the next release of this extension.

24 Nov 2009, 12:21 PM
#1705
fulltilt avatar

fulltilt

New Zenner

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

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

i have also installed css-dropdown menu with multilang ez-pages - all links are working but for ez-pages no titel is visible the link is working ...
How can i get the ez-pages titles in there?

Regards

25 Nov 2009, 4:04 PM
#1706
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

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

kburner:

I am still struggling with getting drop down menu NOT to display at login, shopping cart and checkout.

I am not good with code at All. Would code go in common/tpl_main_page.php or common/tpl_header.php?

It must go something like this? (this is for hiding sideboxes)

$center_column_only = array('login','account','no_account','checkout','create_account', 'shopping_cart');
if (in_array($current_page_base,$center_column_only) ) {
$flag_disable = true;
}

Help!:frusty::frusty:

I think I found area where code should go.
common\tpl_header.php

<!--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-->

I tried code above and with variations and still does not work. Does anyone know code to get drop menu NOT to show on login, shopping_cart, checkout.?

25 Nov 2009, 5:17 PM
#1707
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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

kburner:

I think I found area where code should go.
common\tpl_header.php

<!--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-->

It goes in the includes/templates/custom_folder/common/tpl_main_page. Replace the very first line like this. You can add more or you can show whatever you want.

i```php
f (in_array($current_page_base,explode(",",'contact_us,conditions,privacy,site_map,returns,shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success,account,account_back_in_stock_notifications,account_newsletters,account_notifications')) ) {
     $flag_disable_left = true;
     $flag_disable_right = true;
  }
25 Nov 2009, 5:47 PM
#1708
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

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

countrycharm:

It goes in the includes/templates/custom_folder/common/tpl_main_page. Replace the very first line like this. You can add more or you can show whatever you want.

i```php
f (in_array($current_page_base,explode(",",'contact_us,conditions,privacy,site_map,returns,shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success,account,account_back_in_stock_notifications,account_newsletters,account_notifications')) ) {
$flag_disable_left = true;
$flag_disable_right = true;
}


It worked!!

```html
if (in_array($current_page_base,explode(",",'conditions,privacy,site_map,returns,shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success,account,account_back_in_stock_notifications,account_newsletters,account_notifications')) ) {
    $flag_disable_right = true;
	$flag_disable_left = true;
	$flag_disable_header = true;
  }

I added _header to get it NOT to show. I tried to add banners, but did not work. I am trying to get it to NOT show on same pages.

I tried
$flag_disable_bannerThree = true;
$flag_disable_bannerFive = true;

Did not work..any suggestions?

25 Nov 2009, 9:50 PM
#1709
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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

kburner:

It worked!!

if (in_array($current_page_base,explode(",",'conditions,privacy,site_map,returns,shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success,account,account_back_in_stock_notifications,account_newsletters,account_notifications')) ) {
$flag_disable_right = true;
$flag_disable_left = true;
$flag_disable_header = true;
}

> 
> I tried 
>         $flag_disable_bannerThree = true;
>     $flag_disable_bannerFive = true;
> 
> Did not work..any suggestions?
  Are talking about banners you have made and displaying on your site. In other words you do not want to display the banner on ever page I'm not sure if that can be done without it not being displayed at all. I have 5 different banners that alternate depending what page you are on by the sort order.
26 Nov 2009, 5:14 AM
#1710
meesh avatar

meesh

New Zenner

Join Date:
Feb 2009
Posts:
28
Plugin Contributions:
0

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

Can I get my ez pages to appear in the nav bar? if so, how do I do this. Please give detailed instructions as I am still learning how to code.

Thanks

26 Nov 2009, 1:35 PM
#1711
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

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

countrycharm:

Are talking about banners you have made and displaying on your site. In other words you do not want to display the banner on ever page I'm not sure if that can be done without it not being displayed at all. I have 5 different banners that alternate depending what page you are on by the sort order.

I have a banner that I put several advertisements. I do not want entire banner to show on login, checkout and shopping cart pages.

27 Nov 2009, 4:30 AM
#1712
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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

kburner:

I have a banner that I put several advertisements. I do not want entire banner to show on login, checkout and shopping cart pages.

I will have to do some checking on this. I'm not sure it can be done I will check for you.

30 Nov 2009, 4:12 PM
#1713
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

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

countrycharm:

I will have to do some checking on this. I'm not sure it can be done I will check for you.

Any word?

Thanks, Kim

30 Nov 2009, 5:14 PM
#1714
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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

kburner:

Any word?

Thanks, Kim
Sorry I have not had time. I went to your site in your signature, what banner are you talking about? I think we need to move this to another thread or something. I don't want to hi-jack this thread for this. It's off topic. Sorry guys

30 Nov 2009, 5:44 PM
#1715
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

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

countrycharm:

Sorry I have not had time. I went to your site in your signature, what banner are you talking about? I think we need to move this to another thread or something. I don't want to hi-jack this thread for this. It's off topic. Sorry guys

Were to move it? Can you move this? If I start a new thread -- I do not want to get tagged for posting too many....

Banner is at bottom of page with advertisements in it...Shopmania, upfront, shopspot, etc.

Thanks, Kim

3 Dec 2009, 4:16 PM
#1716
notforever avatar

notforever

New Zenner

Join Date:
Nov 2009
Posts:
2
Plugin Contributions:
0

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

Hello, How can I put all the categories listed in the top(as in target.com)form left to right? i don't want the menu categories, instead I would like that each category was a menu.

Sorry for my english.

thanks

9 Dec 2009, 5:18 PM
#1717
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

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

notforever:

Hello, How can I put all the categories listed in the top(as in target.com)form left to right? i don't want the menu categories, instead I would like that each category was a menu.

Sorry for my english.

thanks

There is actually a mod very similar to this but actually does exactly as you want. The two mods are very similar, so similar that the css is exactly the same (from what I can see), its just the coding that is done differently on one of the files.

You can get the mod here

9 Dec 2009, 6:51 PM
#1718
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

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

I've just added this menu to a new site and can't seem to figure out how to adjust the height?

I wont be using it as a drop down, just purely as a button header row.

Anyone?

9 Dec 2009, 7:42 PM
#1719
timdwyer42 avatar

timdwyer42

Zen Follower

Join Date:
Apr 2009
Posts:
149
Plugin Contributions:
0

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

notforever:

Hello, How can I put all the categories listed in the top(as in target.com)form left to right? i don't want the menu categories, instead I would like that each category was a menu.

Sorry for my english.

thanks

kburner posted the code back a few pages when I asked the same question.

replace all the code in /includes/classes/categories_ul_generator.php
with this

<?php
class zen_categories_ul_generator {
    var $root_category_id = 0,
    $max_level = 6,
    $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) {
      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 = $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 * $level) . '<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);
              }
              $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.

17 Dec 2009, 4:10 PM
#1720
caborela avatar

caborela

New Zenner

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

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

timdwyer42:

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.

Hi Timdqyer42, just wondering if you got the solution of displaying the full path of subcategories on sidebox menu?

anyone?