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 61 to 80 of 2,344
17 Mar 2007, 6:19 PM
#61
jettrue avatar

jettrue

Totally Zenned

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

Post #61 by jettrue

disciple:

Hi,

Is it possible to place the new products, all products, etc. under the categories menu dropdown rather than the home dropdown?

I would also like to take out one of the categories, a document category, from that categories dropdown as well. I have already placed that category in another dropdown menu section but can't seem to figure out how to keep it from showing in the categories dropdown.

Thanks in advance for your help and such a great contribution.

Rick

I tried putting the new products, etc. under the categories when I was working on this add on, and had a heck of a time. Unfortunately, its beyond my capabilities at this time.

As for excluding a category, one way to do this is prevent a certain category from being included in the database query.

Open up includes/classes/categories_ul_generator.

Find this line:

where c.categories_id = cd.categories_id

then directly after it add:

and c.categories_id !=15

replace 15 with the cPath number of the category you want to hide. (to find the number, click on the document category link, and look in the url for the cPath= section. Use that number. Unfortunately its a manual thing, but it works!

18 Mar 2007, 2:47 PM
#62
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #62 by woodymon

jettrue:

There are two files that need to be added:

includes/modules/sideboxes/YOUR_TEMPLATE/ezpages_drop_menu.php
includes/templates/YOUR_TEMPLATE/tpl_ezpages_drop_menu.php

The last path should be:
includes/templates/YOUR_TEMPLATE/templates/tpl_ezpages_drop_menu.php :wink2:

Installing right now. Just wanted to post that tidbit before I forgot. Will report back how it goes. And thanks for doing this!

Woody

18 Mar 2007, 3:58 PM
#63
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #63 by woodymon

Regards to installing EZ-pages into the drop down menu:

I'm a bit lost with STEP 2:

Step 2.
Add this code to includes/templates/YOUR_TEMPLATE/tpl_drop_menu.php

I think you meant:
includes/templates/YOUR_TEMPLATE/common/tpl_drop_menu.php:

My default tpl_drop_menu.php looks like:

  <li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li>
        </ul>
      </li>
      <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CONTACT_US; ?></a></li>

Following the example provided in your step 3 instructions I'm still uncertain where to insert:

<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>

You suggested to place after:

 <?php } ?>

But I don't see that.

Maybe you can provide example file for the helpess? :wink2:

Question: If ez-pages are enabled for drop-down header then they also appear above the drop down menu. Is there an option available to allow display ez-page links in the drop downs but at same time disable ez-page links display above drop downs? Or do I have to remove the following ez-pages display code segment in common/tpl_header.php?

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

Woody

18 Mar 2007, 4:36 PM
#64
jettrue avatar

jettrue

Totally Zenned

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

Post #64 by jettrue

Woodymon:

Regards to installing EZ-pages into the drop down menu:

I'm a bit lost with STEP 2:

I think you meant:
includes/templates/YOUR_TEMPLATE/common/tpl_drop_menu.php:

My default tpl_drop_menu.php looks like:

<li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li> </ul> </li> <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CONTACT_US; ?></a></li> ``` > > Following the example provided in your step 3 instructions I'm still uncertain where to insert: > > ``` <?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?> ``` > > You suggested to place after: > ``` <?php } ?> ``` > > But I don't see that. > > Maybe you can provide example file for the helpess? :wink2:

Yes, I updated tpl_drop_menu.php earlier in this thread, so that the unsubscribe link turns off if you have it turned off in the admin. SO you can change your unsubscribe section to this:

		  <?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
          <li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li>
		  <?php } ?>

Then you can insert:

<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>

Right after that.

Woodymon:

Question: If ez-pages are enabled for drop-down header then they also appear above the drop down menu. Is there an option available to allow display ez-page links in the drop downs but at same time disable ez-page links display above drop downs? Or do I have to remove the following ez-pages display code segment in common/tpl_header.php?

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

If I understand what you're asking, I addressed that in step 4 already:
> If you want to have the regular zen cart horizontal header bar off, go to "Configuration", "EZPages Settings", and turn the header bar display status to off (0).
18 Mar 2007, 4:39 PM
#65
jettrue avatar

jettrue

Totally Zenned

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

Post #65 by jettrue

For those who are adding the ezpages functionality to this mod, I made errors in the file locations. They should be:

includes/modules/sideboxes/YOUR_TEMPLATE/ezpages_drop_menu.php
includes/templates/YOUR_TEMPLATE/templates/tpl_ezpages_drop_menu.php

and you have to make changes to:
includes/templates/YOUR_TEMPLATE/common/tpl_drop_menu.php

I wish I could edit old posts!

18 Mar 2007, 7:15 PM
#66
shackle avatar

shackle

Zen Follower

Join Date:
Apr 2006
Posts:
228
Plugin Contributions:
0

Post #66 by shackle

wow nice!

gonna install the ez-pages addon right now.

Thanks this will be very helpful!

18 Mar 2007, 7:49 PM
#67
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #67 by woodymon

jettrue:

Yes, I updated tpl_drop_menu.php earlier in this thread,
Thanks. I read the complete thread before posting and again read just now. I still don't see where that code change was suggested. More coffee please.

jettrue:

If I understand what you're asking, I addressed that in step 4 already:
Ahh...I did miss that one... as I was unable to proceed past step 2 ;-)

Thanks again.
Woody

18 Mar 2007, 8:01 PM
#68
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #68 by woodymon

jettrue:

Yes, I updated tpl_drop_menu.php earlier in this thread, so that the unsubscribe link turns off if you have it turned off in the admin. SO you can change your unsubscribe section to this:

	  <?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
      <li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li>
	  <?php } ?>
> 
> Then you can insert:
> ```
<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>

Right after that.

Jade-

Would you be kind enough to offer a complete sample file. I've tried to follow your edit instructions but just not working out. Thanks.

Woody

18 Mar 2007, 8:26 PM
#69
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #69 by woodymon

Below is what I've tried, but the menu (and the rest of the page) stops rendering after "Discount Coupons" link.

<ul class="level2">
<li><a href="<?php echo zen_href_link(FILENAME_SHIPPING); ?>"><?php echo HEADER_TITLE_SHIPPING_INFO; ?></a></li>

<li><a href="<?php echo zen_href_link(FILENAME_PRIVACY); ?>"><?php echo HEADER_TITLE_PRIVACY_POLICY; ?></a></li>

<li><a href="<?php echo zen_href_link(FILENAME_CONDITIONS); ?>"><?php echo HEADER_TITLE_CONDITIONS_OF_USE; ?></a></li>

<li><a href="<?php echo zen_href_link(FILENAME_ABOUT_US); ?>"><?php echo HEADER_TITLE_ABOUT_US; ?></a></li>
		  
<?php if (defined('FILENAME_SITE_MAP')) { ?>
     <li><a href="<?php echo zen_href_link(FILENAME_SITE_MAP); ?>"><?php echo HEADER_TITLE_SITE_MAP; ?></a></li>
     <?php } ?>
		  
<li><a href="<?php echo zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_GV_FAQ; ?></a></li>
 
<li><a href="<?php echo zen_href_link(FILENAME_DISCOUNT_COUPON, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_DISCOUNT_COUPON; ?></a></li>
		  
<?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li>
    <?php } ?>

<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>	  
</ul>

What's wrong with this picture?

Woody

18 Mar 2007, 8:38 PM
#70
jettrue avatar

jettrue

Totally Zenned

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

Post #70 by jettrue

Woodymon:

Below is what I've tried, but the menu (and the rest of the page) stops rendering after "Discount Coupons" link.

<ul class="level2"> <li><a href="<?php echo zen_href_link(FILENAME_SHIPPING); ?>"><?php echo HEADER_TITLE_SHIPPING_INFO; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_PRIVACY); ?>"><?php echo HEADER_TITLE_PRIVACY_POLICY; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_CONDITIONS); ?>"><?php echo HEADER_TITLE_CONDITIONS_OF_USE; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_ABOUT_US); ?>"><?php echo HEADER_TITLE_ABOUT_US; ?></a></li> <?php if (defined('FILENAME_SITE_MAP')) { ?>
 <li><a href="<?php echo zen_href_link(FILENAME_SITE_MAP); ?>"><?php echo HEADER_TITLE_SITE_MAP; ?></a></li>
 <?php } ?>
<li><a href="<?php echo zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_GV_FAQ; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_DISCOUNT_COUPON, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_DISCOUNT_COUPON; ?></a></li> <?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
<li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li>
<?php } ?>
<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?> </ul> ``` > > What's wrong with this picture? > > Woody

Hmm, what version of zen cart are you using?

Here is the Information section:

 <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>"><?php echo HEADER_TITLE_INFORMATION; ?></a>
        <ul class="level2">
          <li><a href="<?php echo zen_href_link(FILENAME_SHIPPING); ?>"><?php echo HEADER_TITLE_SHIPPING_INFO; ?></a></li>
          <li><a href="<?php echo zen_href_link(FILENAME_PRIVACY); ?>"><?php echo HEADER_TITLE_PRIVACY_POLICY; ?></a></li>
          <li><a href="<?php echo zen_href_link(FILENAME_CONDITIONS); ?>"><?php echo HEADER_TITLE_CONDITIONS_OF_USE; ?></a></li>
          <li><a href="<?php echo zen_href_link(FILENAME_ABOUT_US); ?>"><?php echo HEADER_TITLE_ABOUT_US; ?></a></li>
          <?php if (defined('FILENAME_SITE_MAP')) { ?>
          <li><a href="<?php echo zen_href_link(FILENAME_SITE_MAP); ?>"><?php echo HEADER_TITLE_SITE_MAP; ?></a></li>
          <?php } ?>
          <?php if (MODULE_ORDER_TOTAL_GV_STATUS == 'true') { ?>
          <li><a href="<?php echo zen_href_link(FILENAME_GV_FAQ, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_GV_FAQ; ?></a></li>
		  <?php } ?>
          <li><a href="<?php echo zen_href_link(FILENAME_DISCOUNT_COUPON, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_DISCOUNT_COUPON; ?></a></li>
		  <?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
          <li><a href="<?php echo zen_href_link(FILENAME_UNSUBSCRIBE, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_UNSUBSCRIBE; ?></a></li>
		  <?php } ?>
		  <?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>
        </ul>
      </li>

Though I don't see anything wrong with your code.

18 Mar 2007, 9:19 PM
#71
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #71 by woodymon

jettrue:

Hmm, what version of zen cart are you using?
v.1.37. The shop is running on PHP 5.16

jettrue:

I don't see anything wrong with your code.
Me neither. I'm going blind looking at it. The menu works fine except when I insert:

<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>

Menu stops rendering at the point the above code is inserted. When I remove the code the menu works fine. Go figure.

Woody

18 Mar 2007, 10:06 PM
#72
jettrue avatar

jettrue

Totally Zenned

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

Post #72 by jettrue

Woodymon:

v.1.37. The shop is running on PHP 5.16

Me neither. I'm going blind looking at it. The menu works fine except when I insert:

<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>
> Menu stops rendering at the point the above code is inserted. When I remove the code the menu works fine. Go figure.
> 
> Woody
Is there an error in your log files? is the ezpages_drop_menu.php loaded in your includes/modules/sideboxes/YOUR_TEMPLATE folder?

Attached is the full ezpages_drop_menu.php file (in text form), just in case something else is off.
19 Mar 2007, 8:45 AM
#73
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #73 by woodymon

jettrue:

For those who are adding the ezpages functionality to this mod, I made errors in the file locations. They should be:

includes/modules/sideboxes/YOUR_TEMPLATE/ezpages_drop_menu.php
includes/templates/YOUR_TEMPLATE/templates/tpl_ezpages_drop_menu.php

NOT!

The last path above should be:
includes/templates/YOUR_TEMPLATE/sideboxes/tpl_ezpages_drop_menu.php

jettrue:

I wish I could edit old posts!
Me too! I got it wrong myself on post #62.
The blind may have led you into the desert. Sorry.
Thanks for the assistance.
Woody

19 Mar 2007, 9:34 AM
#74
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #74 by woodymon

OK now that I've resolved displaying ez-pages in the dropdown menu, I've another related question. And forgive me if already answered or responded to.

A. Before installing the header drop down menu ez-pages "extension" I had a "shop news" ez-pages sidebox displaying in left column. And I want to keep that.

B. And I also had ez-pages displaying in the normal header.

C. Then I added the ability to automatically show ez-pages in the new header dropdown menu.

D. And then followed instructions:

If you want to have the regular zen cart horizontal header bar off, go to "Configuration", "EZPages Settings", and turn the header bar display status to off (0).

E. However now I observe that in order for an ez-page to auto display in the dropdown menu I have to be enable the ez-page to display in BOTH the ez-pages sidebox and ez-pages header. This seems strange.

If I just set the ez-page to display in the header and not the sidebox the ez-page does not display in the dropdown. But I do not want ez-pages that I wish to display in the drop down menu to also display in the left column sidebox (unless I make that choice).

I want ONLY the ez-pages I have marked ONLY to display in the header to display in the dropdown menu only.

I understand I can manually add in ez-pages links to the drop down menu but that's not my point.

I hope my long winded logic is clear here.

Woody

19 Mar 2007, 10:37 AM
#75
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Post #75 by woodymon

Tried out different ez-pages settings and I found a solution/workaround to my dilemma.

The instructions stated:

The sort orders also have to be greater than "0".

So naturally I took this as an instruction to enable the ez-page with a HEADER sort order value >0. Which makes perfect sense.

But what I discovered, and which was not clear to me, is you must ALSO set a SIDEBOX sort order value >0 even if you don't choose to display the ez-page in the sidebox (have it disabled for the sidebox)!

This then allows the ez-page to display in the header dropdown (and not display in the sidebox).

Thanks again for this excellent mod :thumbsup:

Woody

19 Mar 2007, 11:56 AM
#76
jettrue avatar

jettrue

Totally Zenned

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

Post #76 by jettrue

Woodymon:

But what I discovered, and which was not clear to me, is you must ALSO set a SIDEBOX sort order value >0 even if you don't choose to display the ez-page in the sidebox (have it disabled for the sidebox)!
Woody

Wait, now I'm confused. When I use this, I only have to have it enabled for the header to auto-show up in the header, as per my instructions. I have ezpages in my header and NONE of them are set to on for the sidebox. In the Layout Boxes Controller, do you have the left/right status for ezpages_drop_menu.php OFF and ONLY the single column status ON?

ETA: AHA! I just checked, and I did have sort orders for the sideboxes, even though I had them OFF. Will have to check some of my php and see if I can fix that.

21 Mar 2007, 10:15 AM
#77
ces avatar

ces

Zen Follower

Join Date:
Nov 2004
Location:
West Mids, England
Posts:
199
Plugin Contributions:
0

Post #77 by ces

Hi

I'm using your 'simple zen' template on 1.3.6 at the moment and saw this contribution and thought it looks great. I've tested it but all my top level categories show in the menu bar, not just a heading called categories.

Am I doing something daft, or is there an admin setting?

I attach an image to show you.

Thanks

Craig

21 Mar 2007, 12:39 PM
#78
jettrue avatar

jettrue

Totally Zenned

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

Post #78 by jettrue

CES:

Hi

I'm using your 'simple zen' template on 1.3.6 at the moment and saw this contribution and thought it looks great. I've tested it but all my top level categories show in the menu bar, not just a heading called categories.

Am I doing something daft, or is there an admin setting?

I attach an image to show you.

Thanks

Craig

You have to be sure to paste the

<?php require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . 'ezpages_drop_menu.php'); ?>

In the right spot. My guess is you pasted it outside of the information menu. Its got to go before the closing </ul> of the information menu.

21 Mar 2007, 1:41 PM
#79
ces avatar

ces

Zen Follower

Join Date:
Nov 2004
Location:
West Mids, England
Posts:
199
Plugin Contributions:
0

Post #79 by ces

Not sure if we are at cross purposes here, I don't have a problem with ezpages, just the categories menu.

When I hover over the categories menu, nothing shows as all the categories are listed in the bar.

Thanks for your help.

21 Mar 2007, 8:40 PM
#80
jettrue avatar

jettrue

Totally Zenned

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

Post #80 by jettrue

CES:

Not sure if we are at cross purposes here, I don't have a problem with ezpages, just the categories menu.

When I hover over the categories menu, nothing shows as all the categories are listed in the bar.

Thanks for your help.

I'd really need to see a link.