Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"Dynamenu" for osCommerce


Recommended Posts

Firstly, great contribution!

 

Although I do have a slight problem with it, I am using style 1 (the vertical fly out menu), when I put the menu in column_left.php it works fine, i.e. all categories show a small arrow after them and when you hover over them the sub menu flies out. (I included as stated the footer tag in the footer for the page)

 

But when I place it inside my own template them menu displays, but each category does not have an arrow after it, this only appears when you click the category, also the flyout only happens when you click the category not when you hover over it?

 

Does anyone have any idea what i've done wrong? and yes I've included the footer tage in my own template as well. All styles and everything work just great, it seems very strange (I am using STS 4 contrib to make my templates) but each template this system generates still includes footer.php from the OSC includes directory which is the same file I use when it works with thedefault template.

 

Cany anyone help? has anyone here used this contrib in conjunction with STS 4?

 

Regards

 

Dan

 

 

I am having the same issue. I have $show_full_tree = true; but it doesnt all the sub cats when hovering over the categories... only when clicking on them

Link to comment
Share on other sites

I want to change the url in the flyout menu. I would like it to be the way that only the categories which contain products are fitted with a hyperlink. The other categories should only be displayed as a simple text.

 

I already managed to adapt the code so far that when there are no products within the category the link is '' otherwise the link is correct. The only issue I still have is that even withthe link being '' it is still displayed as a link to my shop home directory.

 

Does anybody know how to solve this?

 

Thanks on advance,

Sven

Link to comment
Share on other sites

Hello,

 

I am using Plain Vertical Menu (Option 4) on the dmcategories.php

 

I need help on how to make all of Parent Categories into Bold Font.

 

 

Any help is highly appreciated.

 

 

Thanks!

 

 

fgwapo

Link to comment
Share on other sites

Hello,

 

I'm using dynamenu for some time now and it works great !

 

But recently ma webhost privider moved to PHP5+SQL5 .... I sometimes now get the categories (usig tree menu) very wide and not finish loading ... Instead of categorie name thze link is shown and it's very very wide at this time ....

Can that be due to a PHP5 ?

 

Reloading the page once usually helps, but sometimes not .... I found it quite disturbing ...

 

Thanks for any help / comment.

Link to comment
Share on other sites

hi all!

 

i'am using vertical fly out variant of dynamenu

 

how/where i can set delay for dissappear menu or sub menu? (when mouse out - menus/submenus closes too fast :(

 

Please - someone can give me any idea or instructions to solve this problem?

Link to comment
Share on other sites

I like this menu however it has increased my average page size from about 22k to 100k ... Is there any way to reduce the size? Can I delete some of the CSS?

Yes, if you're using one type of menu only, you can delete the CSS that doesn't pertain to it (it should be evident by the class names and comments what that is)

 

Additionally, for the flyout menus, you can eliminate the containing table tags in the templates if you don't require compatibility with Opera 6 (see template comments for details)...

 

It should be noted that any external CSS and javascript is cached, so subsequent page views are not impacted that much...

** Please do not PM with personal support requests (even if offering "payment"). Thank you.

Link to comment
Share on other sites

Does anyone know how to slow down the menu?

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I am trying for the vertical fly out menu, but I don't think it's working for me, I am using STS 4.5

 

in column_left.php , I put the code include(DIR_WS_BOXES . 'dm_categories.php'); as follow

 

  require(DIR_WS_BOXES . 'whats_new.php');
 require(DIR_WS_BOXES . 'search.php');
 require(DIR_WS_BOXES . 'information.php');
 include(DIR_WS_BOXES . 'dm_categories.php');
// START STS 4.1
}
// END STS 4.1
?>

 

I've copied the images over, functions etc.

 

In the footer, I'm not sure where to put it, I tried a few diff places but not working

 

<?php
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>

<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
 </tr>
</table>

<?php
// Output the footer for Dynamenu for osCommerce
echo $GLOBALS['dmfooter'];
 }
// START STS 4.1
}
// END STS 4.1
?>

 

I also copied over stylesheet, any help would be most appreciated.

 

thanks

Link to comment
Share on other sites

Is there a way to add a static page to the drop down menu to appear with the sub-categories. I would like to add a link in the drop menu right after the last category id is pulled from the database.

 

The example below will illustrate.

 

Tires - Cars - Trucks

16 inch

17 inch

18 inch

Photo Gallery(static page)

 

Mike

Link to comment
Share on other sites

I am trying for the vertical fly out menu, but I don't think it's working for me, I am using STS 4.5

 

in column_left.php , I put the code include(DIR_WS_BOXES . 'dm_categories.php'); as follow

 

  require(DIR_WS_BOXES . 'whats_new.php');
 require(DIR_WS_BOXES . 'search.php');
 require(DIR_WS_BOXES . 'information.php');
 include(DIR_WS_BOXES . 'dm_categories.php');
// START STS 4.1
}
// END STS 4.1
?>

 

I've copied the images over, functions etc.

 

In the footer, I'm not sure where to put it, I tried a few diff places but not working

 

<?php
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>

<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
 </tr>
</table>

<?php
// Output the footer for Dynamenu for osCommerce
echo $GLOBALS['dmfooter'];
 }
// START STS 4.1
}
// END STS 4.1
?>

 

I also copied over stylesheet, any help would be most appreciated.

 

thanks

:thumbsup: Take a look at the STSv4 Power Pack site (site for STS add-ons). I added a step by step for this contribution there. (link in my signature below)

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

:thumbsup: Take a look at the STSv4 Power Pack site (site for STS add-ons). I added a step by step for this contribution there. (link in my signature below)

 

thanks for your help, I was looking at that earlier, but I had the echo in the wrong part of the file. I added it to the correct location, and also added to footer just in case and it's working great now :)

Link to comment
Share on other sites

i got those 2 erros when i use the debug on my shop i can see :

 

Notice: Undefined variable: this_subcat_count in v:\easyphp\www\ms2fr\shop\includes\boxes_content\dm_categories.php on line 303

 

Notice: Undefined variable: output in v:\easyphp\www\ms2fr\shop\includes\boxes_content\dm_categories.php on line 333

 

 

line 303 is :

$this_subcat_count++;

 

line 333 is :

$output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $cPath_new).'|'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";

 

i can give a litlle bit more of my code

 

i checked with all version of dynamneu and i cant find how to fix those erroes :'(

MS2

Link to comment
Share on other sites

in looking at www.ir-usa.com/cat

 

if you mouse over the Canon/HP tab... you will see that there are a lot of printers listed there. In fact so many, that the menu goes all the way to the bottom of the page.

 

Is there anyway that I can control the maximum number of printers listed in one column, and then just have what is not listed there goto the next column?

 

Windows Start Menu does something similar to this when there are a lot of programs installed.

 

Thanks for your help....

 

Mark

Link to comment
Share on other sites

Is there anyway that I can control the maximum number of printers listed in one column, and then just have what is not listed there goto the next column?

Yes, look at the configuration options of the menu, there is one to specify max size of submenus, wherein it will display a more link for menus greater than that number (and more "more"'s if necessary ;))

** Please do not PM with personal support requests (even if offering "payment"). Thank you.

Link to comment
Share on other sites

Yes, look at the configuration options of the menu, there is one to specify max size of submenus, wherein it will display a more link for menus greater than that number (and more "more"'s if necessary ;))

 

Please excuse how stupid this next question may sound..... but can you tell me the neame of the file that I need to look at for the configuration? I have never understood this part of the site very well.

 

I would appreciate it.

 

Thanks.

Link to comment
Share on other sites

Mark, take a look at the stylesheet.css file as well as the dm_categories.php file.

BK,

 

I am so sorry to keep bothering you with this. I do not have a dm_categories.php file... i even did a search using windows... and it cannot locate such a file.

 

In the stylesheet, what is it that should be changed? I did not see anythign that popped out at me.

 

Tahnks again.

 

mark

Link to comment
Share on other sites

If you don't have a dm_categories.php file, then you don't have Dynamenu installed correctly.

 

You should have a dm_cagegories.php file in catalog/includes/boxes/

 

Tracy

 

BK,

 

I am so sorry to keep bothering you with this. I do not have a dm_categories.php file... i even did a search using windows... and it cannot locate such a file.

 

In the stylesheet, what is it that should be changed? I did not see anythign that popped out at me.

 

Tahnks again.

 

mark

~Tracy
 

Link to comment
Share on other sites

hello

 

i'd like to say thank you for this brilliant contrib - its exactly what i needed for my categories menu!

 

 

i'd like to ask if it is possible to do the same for the Aricles Manager navigation.

 

i'm no developer - i tried to get my /boxes/articles.php to do the same as the boxes/dm_categories.php - but no luck for me at all.

 

i'd really appreciate it if someone could help me with this

 

thanks a lot!

 

Tanya

 

link to Article Manager http://addons.oscommerce.com/info/1709

Link to comment
Share on other sites

ok - here's my attempt at trying to make the Articles Manager menu the same as the dynamenu. i'v replaced all category instances with topic instances.

 

it works, sorta..... its displaying both menu's - but the menu behaviour is completely whack now.

 

example - if i click on an Article category - it opens up - but it also opens up the Products category, most categories on either wont open at all - so it seems like its opening up the categories with same ID - even though they use different id names in both files.

 

can anyone please help me with this - tell me what i am doing wrong?

 

pls - i'm not a developer - but i am trying... :blush:

 

<?php
/*
 $Id: dm_categories.php,v 1.00 2006/05/07 01:13:58 nate_02631 Exp $

 Ties the store category menu into the PHP Layers Menu library, allowing display
of categories as DTHML drop-down or fly-out menus, collapsable tree-style menus
or horizontal/vertical indented plain menus.

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2006 Nate Welch [url="http://www.natewelch.com"]http://www.natewelch.com[/url]

 Released under the GNU General Public License
*/

// BEGIN Configuration Options

 // Set the value below corresponding to the type of menu you want to render
// 0 = Horizontal Drop-down; 1 = Vertical Flyout; 2 = Tree Menu;
// 3 = Plain Horizontal Menu; 4 = Plain Vertical Menu
// Include the appropriate stylesheet in your store stylesheet, and if rendering
// types '0' or '1', you must also echo (output) the "menu footer" variable
// in your store footer as described in the readme (or submenus won't work)
$menu_type = 2;

 // Set to false to display the menu output only. Set to true to display in
// a regular box. The former is useful for better integrating the menu with your layout.
$show_dmart_as_box = true;				

 // Set to 'true' to assign TITLE tags to each of the menu's items, 'false' to leave blank
$menu_use_titles = true;	

 // Name of the icon file to be used preceding menu items. Leave blank for no icons.
// NOTE: Does not apply to plain style menus. Icon should be in the /images directory
$menu_icon_file = '';

// Width and height of icons used in menus (does not apply to plain menus).
$menu_icon_width = 16;
$menu_icon_height = 16;

 // Set the graphic to be used for the forward arrow and down arrow images used in 
// drop-down and fly-out menus. Images must reside in your catalog's /images directory
$menu_fwdarrowimg  = 'forward-arrow.png';		
 $menu_downarrowimg = 'down-arrow.png';		

// Indicates whether or not to render your entire category list or just the root categories
// and the currently selected submenu tree. Rendering the full list is useful for dynamic menu
// generation where you want the user to have instant access to all categories. The other option
// is the default oSC behaviour, when the subcats aren't available until the parent is clicked,
// more suitable for plain-style menus 
$show_full_tree = true;		

// For tree menus, set to true to have only nodes corresponding to the current category path
// expanded. If set to false, the tree menu will retain expanded/collapse nodes the user has
// selected (as well as expanding any for categories they've entered)
$menu_tree_current_path = true;				

 // Set the three numerical values below to adjust the offset of submenus in
 // horizontal drop-down and vertical fly-out menus. Values adjust the following (in order)
 // Top Offset: # of pixels from top border of previous menu the submenu appears
 // Right Offset: # of pixels from right border of previous menu the submenu appears
 // Left Offset: # of pixels from left border of previous menu the submenu appears
 // if the submenu pops to left (i.e. if window border is reached).  Negative values are allowed.
 $menu_layer_offset = array (0,4,4);	

// Show icons on tree menus? If set to false, only expand/collapse icons and connecting lines are shown
$GLOBALS['dm_tree_folder_icons'] = true;

// This is the HTML that you would like to appear before/after your categories menu if *not*
// displaying in a standard "box". This is useful for reconciling tables or clearing
// floats, depending on your layout needs.	For example if not including in a box in the
// default osC template, you would need opening/closing <tr><td> tags...
$before_nobox_html = '';
 $after_nobox_html = '';

// Use this option if you have a *lot* of subcategories in a DHTML style menu and your
// submenus won't fit on the page.  Set $divide_subarts to the max # of subcategories you want
// to display.  The menu will show a "more..." link and display the remaining subcategories
// under that selection. Leave at "0" to not divide your subcategories.
$divide_subarts = 0;	

// The text you want to display to indicate more subcategories are available
// This can be set a string or to a language constant you define.
$divide_subarts_text = 'more...';	

// END Configuration Options


// Misc setting to make folder icon clickable to expand tree menu nodes
$GLOBALS['dm_tree_titleclick'] = true;	

// Initialize HTML and info_box class if displaying inside a box
if ($show_dmart_as_box) {
   echo '<tr><td>';
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_ARTICLES);
   new infoBoxHeading($info_box_contents, true, false);					
}

// Generate the menu data output (uses configuration options above)
$articles_string = tep_make_art_dmlist();

// Include required libraries based on menu type
require_once 'includes/functions/dynamenu/lib/PHPLIB.php';
require_once 'includes/functions/dynamenu/lib/layersmenu-common.inc.php';

if ($menu_type < 2) { // Setup for DHTML style menus

   ?>
       <script language="JavaScript" type="text/javascript">
           <!--
               <?php require_once 'includes/functions/dynamenu/libjs/layersmenu-browser_detection.js'; ?>
           // -->
       </script>
       <script language="JavaScript" type="text/javascript" src="includes/functions/dynamenu/libjs/layersmenu-library.js"></script>
       <script language="JavaScript" type="text/javascript" src="includes/functions/dynamenu/libjs/layersmenu.js"></script>
   <?php

   require_once 'includes/functions/dynamenu/lib/layersmenu.inc.php';
   $mid = new LayersMenu($menu_layer_offset[0],$menu_layer_offset[1],$menu_layer_offset[2],1);

} elseif ($menu_type > 2) { // Setup for plain style menus

   require_once 'includes/functions/dynamenu/lib/plainmenu.inc.php';
   $mid = new PlainMenu();

} else {  // Setup for tree style menus

	?>
       <script language="JavaScript" type="text/javascript">
           <!--
               <?php require_once 'includes/functions/dynamenu/libjs/layersmenu-browser_detection.js'; ?>

							<?php

							   if ($menu_tree_current_path) {
								     echo "\n".'var menu_tree_current_path = true';   		   
								 } else {
								     echo "\n".'var menu_tree_current_path = false'; 									 
								 }

							?>
       // -->
       </script>
       <script language="JavaScript" type="text/javascript" src="includes/functions/dynamenu/libjs/layerstreemenu-cookies.js"></script>
   <?php

       require_once 'includes/functions/dynamenu/lib/treemenu.inc.php';
       $mid = new TreeMenu();

}

// Set menu config variables
$mid->setDirroot('./');
$mid->setLibjsdir('./includes/functions/dynamenu/libjs/');

if ($menu_type !=2) {
   $mid->setTpldir('./includes/functions/dynamenu/templates/');
}

$mid->setImgdir('./images/');
$mid->setImgwww('images/');
$mid->setIcondir('./images/');
$mid->setIconwww('images/');
$mid->setIconsize($menu_icon_width, $menu_icon_height);

// Generate menus
$mid->setMenuStructureString($articles_string);
$mid->parseStructureForMenu('artmenu');

switch ($menu_type) {
   case 0: // Horizontal drop-down
       $mid->setDownArrowImg($menu_downarrowimg);
       $mid->setForwardArrowImg($menu_fwdarrowimg);
       $mid->setHorizontalMenuTpl('layersmenu-horizontal_menu.ihtml');						
       $mid->setSubMenuTpl('layersmenu-horiz_sub_menu.ihtml');							
		  $mid->newHorizontalMenu('artmenu');	
			$mid->printHeader();
       $articles_menu = $mid->getMenu('artmenu');
			$GLOBALS['dmfooter'] = $mid->getFooter();								
       break;
   case 1:  // Vertical fly-out
       $mid->setDownArrowImg($menu_downarrowimg);
       $mid->setForwardArrowImg($menu_fwdarrowimg);
       $mid->setVerticalMenuTpl('layersmenu-vertical_menu.ihtml');				
       $mid->setSubMenuTpl('layersmenu-vert_sub_menu.ihtml');							
			$mid->newVerticalMenu('artmenu');
			$mid->printHeader();
       $articles_menu = $mid->getMenu('artmenu');
			$GLOBALS['dmfooter'] = $mid->getFooter();												
       break;
   case 2:  // Tree menu
	    $articles_menu = $mid->newTreeMenu('artmenu');
       break;
   case 3:  // Horizontal plain menu
       $mid->setPlainMenuTpl('layersmenu-horizontal_plain_menu.ihtml');		
       $articles_menu = $mid->newHorizontalPlainMenu('artmenu');							
       break;
   case 4:  // Vertical plain menu
       $mid->setPlainMenuTpl('layersmenu-plain_menu.ihtml');		
       $articles_menu = $mid->newPlainMenu('artmenu');						
       break;	 	 
}	


// Output list inside a box if specified, otherwise just output unordered list
if ($show_dmart_as_box) {
   $info_box_contents = array();
   $info_box_contents[] = array('text' => $articles_menu);
   new infoBox($info_box_contents);
	echo '</td></tr>';	
} else {
	echo $before_nobox_html;	
   echo $articles_menu;
	echo $after_nobox_html;
}

// Create the root category list
function tep_make_art_dmlist($rootartid = 0, $maxlevel = 0){

   global $tPath_array, $show_full_tree, $languages_id;

   global $idname_for_menu, $tPath_array, $show_full_tree, $languages_id;

   // Modify category query if not fetching all categories (limit to root cats and selected subcat tree)
	if (!$show_full_tree) {
       $parent_query	= 'AND (t.parent_id = "0"';	

			if (isset($tPath_array)) {

			    $tPath_array_temp = $tPath_array;

			    foreach($tPath_array_temp AS $key => $value) {
					    $parent_query	.= ' OR t.parent_id = "'.$value.'"';
					}

					unset($tPath_array_temp);
			}	

       $parent_query .= ')';				
	} else {
       $parent_query	= '';	
	}		

	$result = tep_db_query('select t.topics_id, td.topics_name, t.parent_id from ' . TABLE_TOPICS . ' t, ' . TABLE_TOPICS_DESCRIPTION . ' td where t.topics_id = td.topics_id and td.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, td.topics_name');

	while ($row = tep_db_fetch_array($result)) {				
       $table[$row['parent_id']][$row['topics_id']] = $row['topics_name'];
   }

   $output .= tep_make_art_dmbranch($rootartid, $table, 0, $maxlevel);

   return $output;
}

// Create the branches off the category list
function tep_make_art_dmbranch($parcat, $table, $level, $maxlevel) {

   global $tPath_array, $menu_use_titles, $menu_icon_file, $divide_subarts, $divide_subarts_text;

	$lvl_adjust = 1;

   $list = $table[$parcat];

   // Build data for menu
	while(list($key,$val) = each($list)){

			if (isset($tPath_array) && in_array($key, $tPath_array)) {
           $this_expanded = '1';
           $this_selected = 'dmselected';						
       } else {
           $this_expanded = '';
           $this_selected = '';									
	    }	

       if (!$level) {
			    unset($GLOBALS['tPath_set']);
					$GLOBALS['tPath_set'][0] = $key;
           $tPath_new = 'tPath=' . $key;

       } else {
					$GLOBALS['tPath_set'][$level] = $key;		
           $tPath_new = 'tPath=' . implode("_", array_slice($GLOBALS['tPath_set'], 0, ($level+1)));

					$this_subcat_count++;
       }

			if ($menu_use_titles) {
			    $this_title = $val;
			} else {
			    $this_title = '';				
			}				

       if (SHOW_ARTICLE_COUNTS == 'true') {
           $articles_in_topic = tep_count_articles_in_topic($key);
           if ($articles_in_topic > 0) {
               $val .= ' (' . $articles_in_topic . ')';
           }
       }

			// Output for file to be parsed by PHP Layers Menu
			// Each line (terminated by a newline "\n" is a pipe delimited string with the following fields:
			// [dots]|[text]|[link]|[title]|[icon]|[target]|[expanded]
			// dots - number of dots signifies the level of the link '.' root level items, '..' first submenu, etc....
			// text - text for link; title - tooltip for link; icon - icon for link; target - "dmselected" CSS class if item is selected
			// expanded - signifies if the node is expanded or collapsed by default (applies only to tree style menus)

			// Add "more" submenu if dividing subcategories
			if ($this_subcat_count > $divide_subarts && $divide_subarts) {
           $output .= str_repeat(".", $level+$lvl_adjust).'|'.$divide_subarts_text.'||'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";							 
			    $this_subcat_count = 1;
					$lvl_adjust ++;
			}

       $output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $tPath_new).'|'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";							 


       if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) {
           $output .= tep_make_art_dmbranch($key,$table,$level + $lvl_adjust,$maxlevel);
       }

	} // End while loop

   return $output;
}	

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...