Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

DVWarehouse Dynamic Drop Down Menu Tutorial


mrbill

Recommended Posts

Hello All,

 

I recently created a series of drop down menu's using DHTML/CSS (I think that would be the right description) and thought I would share how I did this with the OSC community.

 

DISCLAIMER! - This works for my purposes on my site. It may not work for you or may require additional changes/modifications or will completely screw your site up rendering it useless. BACKUP YOUR FILES before you begin hacking away. Basically DON'T BLAME ME if YOU break something.

WARNING! - This is a really long post. Sorry but it seemed like a good idea at the time.

 

This tutorial should work with any recent 2.2 version of OSC.

 

What does this do?

--------------------------------------------

Navigational links with a drop down listing of your OSC sub-categories.

 

Here is an example image

osc_demo1.jpg

and in action on my site DVWarehouse.com

 

 

How does it work.

--------------------------------------------

First you need to have a few links and a basic DHTML menu to work with.

 

View a simple demo here.

 

The above example shows how the a very basic menu system works. This can be customized to work with popular "rollover" images for navigation as well.

 

 

Using it in OSC.

--------------------------------------------

This gets a little bit more complicated. I'll try to explain it so almost anyone can figure it out. Also the way I have customized this for use on the example website (DVWarehouse.com) may not be flexible enough for your needs, but its a good starting point. This tutorial requires that you set the first TOP categories and not move them because they are hard coded into the menus. Any sub-categories however will work just as they normally would in the admin area. This will make more sense as you read on below. This is the only short coming of this tutorial, maybe I or someone else will expand upon or improve this tutorial later.

 

Get your text editor out and start hacking!

 

I created a function that is a very stripped down version of the one used in includes/boxes/categories.php

 

This fills your menu with links. Create a file called drop_down_menu.php and save it to your includes directory.

<?php

/*

 

 Fill your drop down menu with categories

 

 $Id: drop_down_menu.php

 

 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Released under the GNU General Public License

*/





// this shows the drop down menu section in one little neat package

// call it via: echo dvw_Menu(# of the menu to be show);

// example: echo dvdw_Menu(253);  <--- this would show the parent menu item 253



function dvw_Menu($show_this_cat = ''){

global $languages_id;

echo '<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox"><tr><td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents"><tr><td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td></tr><tr><td align="left" class="boxText">'; 	 

	 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $show_this_cat . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name");  

while ($categories = tep_db_fetch_array($categories_query)) {

 $cPath_new = 'cPath/' . $show_this_cat . '_' . $categories['categories_id'];

 echo '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . $categories['categories_name'] . '</a><br>'; 

}

echo '</td></tr><tr><td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td></tr></table></td></tr></table>';



}





?>

 

NOTE: This is setup to work with 'SEARCH ENGINE SAFE URLs' set to 'TRUE'.

 

Find these lines in the following file includes/column_left.php

  if ( (USE_CACHE == 'true') && !SID) {

    echo tep_cache_categories_box();

  } else {

    include(DIR_WS_BOXES . 'categories.php');

  }

 

and comment them out like below.

 

//   if ( (USE_CACHE == 'true') && !SID) {

//     echo tep_cache_categories_box();

//   } else {

//     include(DIR_WS_BOXES . 'categories.php');

//   }

 

We comment the categories box out, because we won't need it anymore and it causes errors with the new drop down menu.

 

For the last step, we need to edit includes/header.php.

 

On line 45 look for this:

  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {

   if (!is_dir(DIR_FS_DOWNLOAD)) {

     tep_output_warning(WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT);

   }

 }  

 

and add this after it:

 

// [ADD THIS] We need the drop_down_menu.php functions

 require('includes/drop_down_menu.php');

// [ADD THIS] eof_We need the drop_down_menu.php functions

 

On line 51 look for this:

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <tr class="header">

   <td valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce'); ?></td>

   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>

 </tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

 <tr class="headerNavigation">

   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

 </tr>

</table>

 

We want to add some code between the two tables. It should look like this:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <tr class="header">

   <td valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce'); ?></td>

   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>

 </tr>

</table>





<!-- [ADD THIS] THIS IS THE STUFF TO MAKE THE DROP DOWN MENUS APPEAR -->

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_findObj(n, d) { //v4.01

 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

 if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_showHideLayers() { //v6.0

 var i,p,v,obj,args=MM_showHideLayers.arguments;

 for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

   if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }

   obj.visibility=v; }

}

//-->

</script>

<!-- [ADD THIS] eof_THIS IS THE STUFF TO MAKE THE DROP DOWN MENUS APPEAR -->



<br>



<div style="position:absolute; left:0; top:0">

<!-- THIS IS MY EXAMPLE NAVIGATION -->        

<table>

<tr><td class="main">



<!-- [ADD THIS] HERE ARE THE LAYERS -->

<div id="hideAll1" style="position:absolute; left:0; top:0; width:500; height:50; z-index:10; visibility: hidden;"><a href="#" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','hide','hideAll1','','hide','hideAll2','','hide')"><img src="images/pixel_trans.gif" width="500" height="50" border=0></a></div>

<div id="hideAll2" style="position:absolute; left:0; top:90px; width:500; height:350; z-index:10; visibility: hidden;"><a href="#" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','hide','hideAll1','','hide','hideAll2','','hide')"><img src="images/pixel_trans.gif" width="500" height="350" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','hide','hideAll','','hide')" border=0></a></div>



<div id="layer1" style="position:absolute; left:8px; top:68px; width:164px; height:190px; z-index:20; background-color: #CC9900; layer-background-color: #CC9900; border: 1px none #000000; visibility: hidden;">

<div align="center"><p><?php 



// THIS IS WHERE THE MAGIC HAPPENS

// Just put the number of the top categorie 

// in between the '(' and ')' that you want to display.

// Repeat for the others below.

echo dvw_Menu(1); 





?></p></div></div>

<div id="layer2" style="position:absolute; left:82px; top:68px; width:164px; height:190px; z-index:20; background-color: #CC0000; layer-background-color: #CC0000; border: 1px none #000000; visibility: hidden;">

<div align="center"><p><?php echo dvw_Menu(2); ?></p></div></div>

<div id="layer3" style="position:absolute; left:135px; top:68px; width:164px; height:190px; z-index:20; background-color: #0066FF; layer-background-color: #0066FF; border: 1px none #000000; visibility: hidden;">

<div align="center"><p><?php echo dvw_Menu(3); ?></p></div></div>

<!-- [ADD THIS] eof_HERE ARE THE LAYERS -->





<!-- [ADD THIS] THESE ARE THE LINKS -->

<div id="nav" style="position:absolute; left:10px; top:47px; width:230px; height:20px; z-index:30; border: 1px none #000000; visibility: visible; background-color: #CCCCCC;">

<b> <a href="#" onMouseOver="MM_showHideLayers('layer1','','show','layer2','','hide','layer3','','hide','hideAll1','','show','hideAll2','','show')">Hardware</a> | 

<a href="#" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','show','layer3','','hide','hideAll1','','show','hideAll2','','show')">Software</a> | 

<a href="#" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','show','hideAll1','','show','hideAll2','','show')">DVD Movies</a>

</b></div>

<!-- [ADD THIS] eof_THESE ARE THE LINKS -->



</td></tr>

</table>

</div>







<table border="0" width="100%" cellspacing="0" cellpadding="1">

 <tr class="headerNavigation">

   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

 </tr>

</table>

 

And that is it.

 

Here is an example of a finished site, using this tutorial.

osc_demo2.jpg

 

Missed something? or just need the files used in this tutorial?

Download them here.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

FWIW i put the second sectioj of code (that goes between the tables) in to a file called drop_down_section.php (als in the inlcudes directories , and included it like this .... makes it easier to take in our out if your testing ...

 

<?php

 

 // [ADD THIS] We need the drop_down_menu.php functions 

 require('includes/drop_down_section.php'); 

// [ADD THIS] eof_We need the drop_down_menu.php functions

?>

Link to comment
Share on other sites

Was thinking this might be worth a little more refining. Fix it so it works clean and configurable in with the backend/admin section and then it would be worth a contribution.

 

Good to hear that a few of you can make use of this.

 

If someone else wants to clean this up for a contribution you have my blessing. Otherwise this will be one of those things that I'll get to later than sooner, I think.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

  • 4 weeks later...

I am very new to this.. and learnng php as a go

 

I really like this drop down menu..

and I know I have to configure it to show my categies..

 

so could you please lead me in right direction...

 

I guess I don't know enough to know where to change the code to get my categories..

 

all help would be apperiated..

Thank you

 

Naomi

Link to comment
Share on other sites

Noppie -

 

Look for the lines between my comments

<!-- [ADD THIS] HERE ARE THE LAYERS --> ... <!-- [ADD THIS] eof_HERE ARE THE LAYERS -->

 

Inside the area bounded by the two comments look for

 echo dvw_Menu(1);

 

The number in between the '(' and ')' are where you set your main categories. The default installation of OSC has the parent categories set to '1', '2', and '3'. If you have added or modified your catalog your numbers may be different.

 

I checked out your site at 'rainbowstop' and could see one of your categories is '37'. Replace your number like this, example:

echo dvw_Menu(37);

 

do the same for the rest of your site. The parent categories are your top most categories, in your admin area go to the CATALOG and mouse over the links to each of your TOP CATAGORIES, the number after /cpath/ will be the number you want.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

only that i cant get the link to work

:x

 

What error are you getting, if any? Can you provide an example URL? You can IM or leave me a message in the forum if your site is not ready for public access.

 

Bill

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

  • 3 weeks later...

Hi there,

 

Please help here. I've inserted your menu and replaced the demo-categories with some images. But now the images get a border. Where does that coming from?? Please help me, I'm struggling for some time now...

 

Theo

Link to comment
Share on other sites

Hi there,

 

But now the images get a border. Where does that coming from??  

 

Theo

 

Add the 'border=0' option to your anchor link.

 

ex:

<a href="some_link_here" BORDER="0">Name of Link here</a>

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Actually - the code should look like this:

<a href="some_link_here"><img src="some_image_name_here.jpg" BORDER="0"></a>

[/code

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Add the 'border=0' option to your anchor link.

 

ex:

<a href="some_link_here" BORDER="0">Name of Link here</a>

 

This didn't work but the following did:

 

<a href="some_link_here"><img src="some_image.gif" BORDER="0"></a>

 

Thanks mrbill, you did point me in the right direction.[/code]

Link to comment
Share on other sites

hi,

 

when i want to click on the parent category, i'm sent to http://localhost/catalog/# which is the address in the status bar (all my files are shown), and i can't be sent to the parent category.

 

And then the sub category didn't work till i replaced cpath/ by cpath= in the drop_down_menu.php.

but for parent category i think i have to insert an if statement like in categories.php but i don't know exactly which one

 

any help is welcome

 

 

pldtm

PL DTM

-----------------------------------------

Sur un malentendu, ... ?a pourrait marcher

Link to comment
Share on other sites

ok i found that i had to change # by default.php?cPath=1 in the <a href ... if i wanted to have a link in the right parent category and it works but i don't know if i loose my php session or not, or if there is a better way to achieve it.

 

 

pldtm

PL DTM

-----------------------------------------

Sur un malentendu, ... ?a pourrait marcher

Link to comment
Share on other sites

You can try this out for your top category link, haven't tested it yet but think it should work. Just change the "cPath=1" to the number of your category.

<!-- [ADD THIS] THESE ARE THE LINKS --> 

<div id="nav" style="position:absolute; left:10px; top:47px; width:230px; height:20px; z-index:30; border: 1px none #000000; visibility: visible; background-color: #CCCCCC;"> 

<b> <a href="<?php echo tep_href_link(default.php?cPath=1, '', 'NONSSL'); ?>" onMouseOver="MM_showHideLayers('layer1','','show','layer2','','hide','layer3','','hide','hideAll1','','show','hideAll2','','show')">Hardware</a> | 

<a href="<?php echo tep_href_link(default.php?cPath=1, '', 'NONSSL'); ?>" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','show','layer3','','hide','hideAll1','','show','hideAll2','','show')">Software</a> | 

<a href="<?php echo tep_href_link(default.php?cPath=1, '', 'NONSSL'); ?>" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','show','hideAll1','','show','hideAll2','','show')">DVD Movies</a> 

</b></div> 

<!-- [ADD THIS] eof_THESE ARE THE LINKS -->

This is an example of a typical osC anchor tag.

  <a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>">Link to Home page</a>

 

 

My drop down menu modification requires that you enable "SEARCH ENGINE SAFE URLs" in the admin section for your site. This is why you had problems the "/" at the end of your URL/Link. I noted this in the instructions. Your way works too, if you don't want to use the "SEARCH ENGINE SAFE URLs" feature of osC.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

ok i will try it, and in fact i can't use safe url, because of pdf_datasheet maker? If i use it all informations desappear in my pdf document.

 

 

thanks for your help

 

 

pldtm

PL DTM

-----------------------------------------

Sur un malentendu, ... ?a pourrait marcher

Link to comment
Share on other sites

I have installed the menu which at the moment is functioning the same as the demo.

 

Theres a few problems i have though...

 

 

1. I would like the bar to appear as my buttons, which i have already created by inserting a predesigned page that i defined in the header.php

<td valign="middle"><?php include('includes/html/index.htm'); ?>

 

I suppose what im asking, is do i put the code in my html page or does the code stay in the header with reference to the html page.

 

Ive tried a few different things and it seems they dont work.

 

All im trying to achieve is that the pop appears when someone puts a mouse over my button.

 

2. I have a black line where the usual breadcrumb trail is?

 

3. The box doesnt close when you move your mouse elsewhere on the screen.

 

Any help would be appreciated.

 

PR

Link to comment
Share on other sites

Went to www.domecomputers.co.uk and here are my answers or lack of an answer for you.

 

 

Theres a few problems i have though...

 

 

1. I would like the bar to appear as my buttons, which i have already created by inserting a predesigned page that i defined in the header.php

<td valign="middle"><?php include('includes/html/index.htm'); ?>

 

 

I suppose what im asking, is do i put the code in my html page or does the code stay in the header with reference to the html page.

 

Ive tried a few different things and it seems they dont work.  

 

Not enough info to figure out what you have in your INCLUDE file /html/index.htm. Haven't tried out my hack any other way than what the instructions indicate. With a little experimentation you should be able to get away with it being used in your include (maybe).

 

All im trying to achieve is that the pop appears when someone puts a mouse over my button.

The drop down menu seems to be working only in a limited capacity on your site. It should be showing the contents of your categories but I don't see these links in the menu. You should try to solve that problem first.

 

The Javascript -

<!-- [ADD THIS] THIS IS THE STUFF TO MAKE THE DROP DOWN MENUS APPEAR --> 

<script language="JavaScript" type="text/JavaScript"> 

<!-- 

function MM_findObj(n, d) { //v4.01 

 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 

   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 

 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 

 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 

 if(!x && d.getElementById) x=d.getElementById(n); return x; 

} 



function MM_showHideLayers() { //v6.0 

 var i,p,v,obj,args=MM_showHideLayers.arguments; 

 for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; 

   if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } 

   obj.visibility=v; } 

} 

//--> 

</script> 

<!-- [ADD THIS] eof_THIS IS THE STUFF TO MAKE THE DROP DOWN MENUS APPEAR -->

May be interffering with the Javascipt your using, remove anything that is redundant like the MM_findObj.

 

 

2. I have a black line where the usual breadcrumb trail is?

 

3. The box doesnt close when you move your mouse elsewhere on the screen.

2 - Don't know, its not related to my mod, but would guess your leaving something out the defines what to show in breadcrumb trail.

 

3 - You left out a couple of layers that are hidden in the background when a menu drops down. They are activated outside of the menu and close any layers that are shown. Its not the best way to do this, but is a quick and dirty solution that worked for me.

 

Missing layers, this makes the active layers hide.

<div id="hideAll1" style="position:absolute; left:0; top:0; width:500; height:50; z-index:10; visibility: hidden;"><a href="#" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','hide','hideAll1','','hide','hideAll2','','hide')"><img src="images/pixel_trans.gif" width="500" height="50" border=0></a></div> 

<div id="hideAll2" style="position:absolute; left:0; top:90px; width:500; height:350; z-index:10; visibility: hidden;"><a href="#" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','hide','hideAll1','','hide','hideAll2','','hide')"><img src="images/pixel_trans.gif" width="500" height="350" onMouseOver="MM_showHideLayers('layer1','','hide','layer2','','hide','layer3','','hide','hideAll','','hide')" border=0></a></div>

 

All in all, looks like you have quite a bit of fixing to do.

 

Your mouseover/rollover effect when using an image with my menu mod will require you to modify my mod further. Check out the "onMouseOver" and add what ever you need to make the menu work with the rollover function "MM_swapimage()".

 

Hope that helps or at least doesn't add too much more to your confusion already.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Thanks for the reply.

 

If you dont know the answers, ive got no chance!

 

On the DV warehouse menu, is the code in your header or is it an include file like mine? I would like similar buttons to those of DV warehouse.

 

In relation to the drop down not closing..........is it anything to do 2 div layers that were there?

 

Perhaps i could go and acquire another dhtml menu system........how would i get it to show categories?

 

Any help would be appreciated

 

PR

Link to comment
Share on other sites

  • 5 months later...

I am using this drop down and it works great. Thanks for the great directions. Does anyone know how I could add my list of manufacturers to this - so that it is right next to the last main category and its lists all the manufacturers in my database?

Any help, hints or guidance would be greatly appreciated.

Thanks

Charity

Link to comment
Share on other sites

I really just need another function similar to the dvw_Menu() function. I can add it below on the drop_down_menu.php page. But this function would query the manufacturers table and populate the drop down with a list of manufacturers as hyperlinks. I can incorporate this into the header.php page, I just need help writing this fucntion. If anyone can point me to some documentation on how to do this please let me know.

Thanks,

Charity

Link to comment
Share on other sites

Ok, I figured out how to add another layer and put my list of manufacturers in it. I then moved my dropdowns to the center of the page. But when I move my cursor to the left of the first dropdown the dropdown does not go away. I think it has something to do with the hidden layers positioning but I don't know exactly which positions to change. I've tried experimenting but I can't fix it.

 

I don't think anyone is actually reading this thread but I thought I try just in case.

If anyone knows how to fix this I'd appreciate any help.

Thanks,

Charity

Link to comment
Share on other sites

  • 2 weeks later...

Hello all -

 

Just wanted to add a simple change to this tutorial that is often asked about.

 

Some of you use OSC with search engine safe urls' off. In the instructions I mention that its required to have this feature on, you can go around this requirement.

 

---------------------------------------------------------------------

You should be able to modify to work with your setup.

 

1) Open "drop_down_menu.php"

2) Look for line 25, you should see $cPath_new = 'cPath/'

3) change 'cPath/' to 'cPath=' , the equals sign rather than the forward slash should solve your problem.

 

---------------------------------------------------------------------

 

Haven't tested but it should work. Improvements are welcomed, email or PM here and I'll add them to a newer improved version for download on my website eventually.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Ok, I figured out how to add another layer and put my list of manufacturers in it. I then moved my dropdowns to the center of the page. But when I move my cursor to the left of the first dropdown the dropdown does not go away. I think it has something to do with the hidden layers positioning but I don't know exactly which positions to change.

Hi Charity,

 

Do you have a sample URL that I can look at? I'll try to lend a hand if I can. Send me a PM or email me directly I don't check here very often for questions.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

  • 5 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...