Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"Dynamenu" for osCommerce


Recommended Posts

Erm... CSS... ;)

 

Found it after that post; sorry. Thanks for your replies Nate.

 

And now the last problem: I can't seem to get the tree menu items (my products stuff) to turn bold when selected, as well as the tree's don't expand automatically like they should. I'm sure it's my own coding problem, but any guidance on where to look?

 

You can see an example of my lame menu here: www.hawg-wired.com

 

I'd paste code here too, if I knew what I should paste here...

Link to comment
Share on other sites

Found it after that post; sorry. Thanks for your replies Nate.

 

And now the last problem: I can't seem to get the tree menu items (my products stuff) to turn bold when selected, as well as the tree's don't expand automatically like they should. I'm sure it's my own coding problem, but any guidance on where to look?

 

You can see an example of my lame menu here: www.hawg-wired.com

 

I'd paste code here too, if I knew what I should paste here...

 

Once again I waste board space, my bad. I'm on it now, should be able to figure it out now. Thanks to all on this righteous osC site!

Link to comment
Share on other sites

You can see an example of my lame menu here: www.hawg-wired.com

That's pretty neat the way you have the products... I was actually intrigued by the notion of having direct links to products in the category menu, but couldn't quite get the DB query right to feed to the generator.

 

I had a query which would get categories which *had* products (which would work in your instance), but not one to build a proper tree in the case when a category did not contain any products (which of course would result in broken "nodes" on the tree menu if a category, say, contained only subcategories)... It's like a LEFT JOIN or something of *five* different tables - yeech!

 

I don't know if you came up with the latter DB query either, but it would be interesting to see if you want to post just the changes you made to the query and output section... Nice work!

 

P.S. Your "trees" are not expanding based on the category you are in, not sure if that's intentional or not...

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

Link to comment
Share on other sites

That's pretty neat the way you have the products... I was actually intrigued by the notion of having direct links to products in the category menu, but couldn't quite get the DB query right to feed to the generator...

 

Hey, thanks for the compliment! I think you're right about my method though, it's probably not working right because of the way I build the list. The item highlight works now, but it doesn't expanding the category automatically. What can I say, I barely know what I'm doing at best.

 

For what it's worth though, here's the stuff I added:

 

In dm_categories.php, in the tep_make_cat_dmbranch function

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


			// mikeys product listing
			$products_in_category_query = tep_products_in_category($key);

			while ($products_in_category = tep_db_fetch_array($products_in_category_query)) {

			  $product_id_h = 'products_id='.$products_in_category ['product_id'];
			  $product_name_h = $products_in_category ['product'];

			  if ($GLOBALS['products_id'] == $products_in_category ['product_id']) {
				$that_expanded = '1';
				$that_selected = 'dmselected';
			  } else {
				$that_expanded = '';
				$that_selected = '';
			  }

			  if ($menu_use_titles) {
				$that_title = $product_name_h;
			  } else {
				$that_title = '';
			  }

			  $output .= str_repeat(".", $level+2).'|'.$product_name_h.'|'.tep_href_link(FILENAME_PRODUCT_INFO, $product_id_h).'|'.$that_title.'|'.$menu_icon_file.'|'.$that_selected.'|'.$that_expanded."\n";
			} //EOF mikeys product listing


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

	} // End while loop

 

Most of that stuff came from a contribution I found here called Category Tree v.8 (authors name is Joe) that listed products in the regular categories.php. It came with this cool function I added to my general.php file:

//// USED FOR PRODUCTS IN CATAGORY MENU
// Return the query for products in a category
// TABLES: products, products_to_categories, and products_description
 function tep_products_in_category($category_id, $include_inactive = false) {

if ($include_inactive) {
  $products_query = tep_db_query("select p.products_model as product, pd.products_id as product_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = p2c.products_id and p2c.categories_id = '" . $category_id . "' and p.products_id = pd.products_id order by p.products_model");
} else {
  $products_query = tep_db_query("select p.products_model as product, pd.products_id as product_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . $category_id . "' and p.products_id = pd.products_id order by p.products_model");
}

return $products_query;
 }

 

Anyway, I'm happy that it works for my needs, but would still like to get the auto expand to work properly...

 

Thanks again for your help Nate, much appreciated,

Mike

Edited by hawgwired
Link to comment
Share on other sites

O.K. Thought it was some kind of recursive DB query like that. A bit too many queries for my liking, but should be fine for a store with a few categories.

 

As for the expanded thing, I don't see where $GLOBALS['products_id'] is being set... Maybe that's the problem? I might just do the same comparo for expanded nodes that is done for categories for products, maybe:

if (isset($cPath_array) && in_array($products_in_category ['product_id'], $cPath_array)) {
 $that_expanded = '1';...

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

Link to comment
Share on other sites

O.K. Thought it was some kind of recursive DB query like that. A bit too many queries for my liking, but should be fine for a store with a few categories.

 

As for the expanded thing, I don't see where $GLOBALS['products_id'] is being set... Maybe that's the problem? I might just do the same comparo for expanded nodes that is done for categories for products, maybe:

if (isset($cPath_array) && in_array($products_in_category ['product_id'], $cPath_array)) {
 $that_expanded = '1';...

 

You know, that's the way I started out, but for whatever reason, using cPath that way doesn't work for my stuff; not only does it not expand the node, but it doesn't do the bold thing either. I'm using the $GLOBALS['products_id'] as a last resort, and it does seem to make the bold thing work, but not the expanding thing. Pretty wierd too, considering that $that_expanded and $that_selected are both being set at the same time, but only $that_selected seems to work. Hmm...

Link to comment
Share on other sites

Nate,

 

Great contibution, just what I was looking for. I ran into a little snag though with the flying-vertical. I have one sub category that has about 40 categories. The 40 categories don't all apear and when you try to scroll down the list the menu disappears. Is the a way to add a scroll option kinda like a web brousers book marks when there's to many in there or can we have about 20 then the next 20 next to that. Here's what I have.

 

Current

main category

sub category

sub sub category 1

sub sub category 2

sub sub category 3

sub sub category .

sub sub category .

sub sub category .

sub sub category 40

 

Would like

main category

sub category

sub sub category 1

sub sub category 2

sub sub category 3

sub sub category .

sub sub category 20

!!!scroll option!!!

sub sub category .

sub sub category 40

 

or would like

main category

sub category

sub sub category 1 sub sub category 38

sub sub category 2 sub sub category 39

sub sub category 3 sub sub category 40

 

I can provide a like so you can see the problem if needed.

 

thanks,

 

Another Nate

Link to comment
Share on other sites

The 40 categories don't all apear and when you try to scroll down the list the menu disappears. Is the a way to add a scroll option kinda like a web brousers book marks when there's to many in there or can we have about 20 then the next 20 next to that.

Sorry, I do not know a way to do that, nor have seen any dynamic-style menu's that do that. The submenus do reposition themselves if hitting a window edge as to be all visible, but if the rendered submenu height is greater than the height of the viewable window, that is another story.

 

I might suggest:

> Restructure your category layout as not to have as many subcategories under a single category

> Adjust the font-size, padding of the submenus to smaller type/less padding. The submenus can have a different style than the root menu items.

> Go with the tree menu type(?)

 

It's not exactly a scroll option, but you might tweak the dm_categories.php tep_make_cat_dmbranch function to keep track of the count of the current "level" and if it reaches a certain point, have it add a menu option "more...", then continue adding the rest of the subcats one level under.

 

So the user would see the first 20 or so subcats, then a "more" category with the subcats being the other 20 categories... Tricky to figure out, but probably not hard to implement. Something to consider for a future release ;)

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

Link to comment
Share on other sites

hi , thanks to bring us this awesome menu to oscomerce ...

 

Idea 1 : I m thinking about bringing the configuration done in the php file to the admin for easier choosing and testing

 

Idea 2 : instead of copying the css included in dynamenu_for_osc_styles.txt , i renamed it stylesheet_dynamenu.css and copied it in the same folder (/catalog) than the stylesheet.css and then in stylesheet_dynamenu.css i added this code :

/*  dynamenu (edit in stylesheet_dynamenu.css BOF ********************* */
@import url(stylesheet_dynamenu.css);
/*  dynamenu (edit in stylesheet_dynamenu.css EOF ********************* */

 

 

Problem 1 ! for the moment i m trying the tree menu :and i can see like an image is missing in the left top corner of the tree menu, does it appears with someone else

 

Problem 2 : If i use tree menu , can i leave in the footer the code

	// Output the footer for Dynamenu for osCommerce
echo $GLOBALS['dmfooter'];

and it ll make no harm or i Must comment it absolutely ?

MS2

Link to comment
Share on other sites

hi , thanks to bring us this awesome menu to oscomerce ...

You're welcome!

Idea 1 : I m thinking about bringing the configuration done in the php file to the admin for easier choosing and testing

My thoughts is that a layout/menu for a website remains stable once it is settled on. Better to adjust a few easy config values than to gum up the admin with more options ;)

Idea 2 : instead of copying the css included in dynamenu_for_osc_styles.txt , i renamed it stylesheet_dynamenu.css and copied it in the same folder (/catalog) than the stylesheet.css and then in stylesheet_dynamenu.css...

Same views as above... Better to just include the .css then having your server import another file... Though this is a minor difference...

Problem 1 ! for the moment i m trying the tree menu :and i can see like an image is missing in the left top corner of the tree menu, does it appears with someone else

It would be helpful if you mentioned what the image is - and no I'm not going to tell you how to do that ;) I have not experienced this - check the all image files were uploaded and that your server has permission to read them...

Problem 2 : If i use tree menu , can i leave in the footer the code
	// Output the footer for Dynamenu for osCommerce
echo $GLOBALS['dmfooter'];

and it ll make no harm or i Must comment it absolutely ?

Leaving the dmfooter global variable will do no harm nor generate bulks of unnecessary code if you leave it in for tree/plain menu styles...

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

Link to comment
Share on other sites

Version 1.1 Released!

 

Thanks to some feedback on this thread from dAbserver and beisupplies, a modest update has been released for Dynamenu for osCommerce.

 

It allows you to "split" a subcategory menu should you have a lot of subcats for a given category and find them running off the screen (with DHTML menus). You can specify the max # of subcats for a given category you want to display (X) and DM will generate a "more" subcat with the rest of the subcats under it for every X subcategories.

 

Also I've included some modestly upated DHTML templates (for use with drop-down or fly-out menus) which nuke some of the containing tables necessary for compatibility with browsers Opera 6/MSIE 5 or less. Also the "transparent.png" images were removed from the templates which seem to have no ill effect. Saves a lot of code if you have a ton of categories and don't need to support these older browsers. Find the alternate templates in the ~xtras folder...

 

Existing DM users need only copy over their dm_categories file and reset their configuration options. (and optionally replace the DHTML templates with the alternate ones included)...

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

Link to comment
Share on other sites

Version 1.1 Released!

 

Thanks to some feedback on this thread from dAbserver and beisupplies, a modest update has been released for Dynamenu for osCommerce.

 

It allows you to "split" a subcategory menu should you have a lot of subcats for a given category and find them running off the screen (with DHTML menus). You can specify the max # of subcats for a given category you want to display (X) and DM will generate a "more" subcat with the rest of the subcats under it for every X subcategories.

 

Also I've included some modestly upated DHTML templates (for use with drop-down or fly-out menus) which nuke some of the containing tables necessary for compatibility with browsers Opera 6/MSIE 5 or less. Also the "transparent.png" images were removed from the templates which seem to have no ill effect. Saves a lot of code if you have a ton of categories and don't need to support these older browsers. Find the alternate templates in the ~xtras folder...

 

Existing DM users need only copy over their dm_categories file and reset their configuration options. (and optionally replace the DHTML templates with the alternate ones included)...

 

 

Thank you Nate!!!! After spending about 2-4 hours yesterday trying to figure out how to add the "more" option in, I had given up and switch to a tree menu. I've already installed the mod/update locally and will be updating it live.

 

Thanks for taking the time to reply to post and updating the contribution.

 

This is one of the best contributions along w/ MVS1.1 and Header Tags.

 

thanks again,

 

Nate

Link to comment
Share on other sites

Problem 1 ! for the moment i m trying the tree menu :and i can see like an image is missing in the left top corner of the tree menu, does it appears with someone else

 

this is tree_expand_corner_first.png that is missing

MS2

Link to comment
Share on other sites

Hey Nate - thank you so much for the awesome contribution! It was exactly what I needed for an art site my friend and I are developing for my brother where we have tons of categories and subcategories, and subcategories...

 

Right now we are doing all the updates offline and we haven't uploaded our recent changes with the menu installed but we will soon (hopefully before you see this posting). Our beta site (not publicly announced/launched yet): http://www.aestheticfunction.com/strtest/

 

I love the Tree and flyout menus and I'm having a hard time figuring out which one to use :) Probably we'll end up going with the tree menu because the vertical flyout is running really too slow in opera 8+ (at least on my mac) and I wouldn't want visitors using opera to be bummed. It kind of sucks because i like the flyout better for this application.

 

I have a few questions I am hoping you or others here on this forum could help us with if you get a chance:

 

1) It would be extremely helpful to have separate styles for the tree menu > subcategories as you have done for the vertical flyout. We tried to figure out how to apply the styles on our own but we couldn't figure it out :huh: Do you have any insight on that? Is it even possible?

 

The reason we really need it is because we have our sub and sub-sub-categories assigned to their parent categories to provide multiple options for viewing paintings (grouped together, or narrowed categories).

 

If a user clicks 'animals' he will see all items within all sub and subcategories in the product listing area (thumbnails etc.) - but he then has the opportunity to refine his search by clicking on 'birds' or whatever, "if" he sees that he can. The important thing for us is that the display/design/style of the subcategories in the categories infobox must catch the users' eyes so they know that the branch has expanded and there are subcategories to refine their search. Anyway, I'm sure you get the point... right now, the goober user might not figure out or see that the parent category has expanded like a tree roots and provided for a refined list of subcategories.

 

Animals

---Aquatic Life

---Birds

------sparrows

------eagles

---Cats & Kittens

 

2) I think I saw you mention something in this thread to the affect that the first category in the list, when clicked, doesn't automatically branch out/expand... Is that a common bug? How fixable is it?

 

3) Any clue why the flyout menu would be so darn slow on Opera 8+ using a mac (not sure about PC's)?

 

4) I need to find something like your horizontal flyout menu but for my main links. Do you have any recommendations?

 

Thanks again for the contrib!

 

Hope to chat with you soon,

Jonathan

Link to comment
Share on other sites

Great Contribution! Easy to install and configure!

 

However, I have one question. I'm sure this is simple, but I just can't seem to figure it out. I'm using the tree menu style and wondering how I go about changing the color of the "+" & "-" symbols. They are currently black and my background is also black so you can't really see them. I'd like to change them to white if possible.

 

Thanks in advance for any help!

Shayne

Link to comment
Share on other sites

in fact tree_collapse_corner_first.png AND

tree_expand_corner_first.png are missing

Gosh, I've never noticed that - never got a broken image and in the thousands of Dynamenu for PN downloads, noones ever mentioned it(!)... Will upload a new package to the contribs, as soon as I can...

 

1) It would be extremely helpful to have separate styles for the tree menu > subcategories as you have done for the vertical flyout. We tried to figure out how to apply the styles on our own but we couldn't figure it out :huh: Do you have any insight on that? Is it even possible?

Probably possible, but no I do not have a solution for that... Maybe some kind of hack to build function to change root level items (similar to how items are marked selected or expanded?

 

2) I think I saw you mention something in this thread to the affect that the first category in the list, when clicked, doesn't automatically branch out/expand... Is that a common bug? How fixable is it?

It only seems to manifest itself if the product is clicked from "What's New" or something like that. If the person implicitly expands the node, it appears to work fine...

 

 

3) Any clue why the flyout menu would be so darn slow on Opera 8+ using a mac (not sure about PC's)?

Tested on Opera * on PC and no issues... Not sure about macs....

4) I need to find something like your horizontal flyout menu but for my main links. Do you have any recommendations?

Yes, you can use the PHP Layers menu libraries... They can coexist on the same page....

 

However, I have one question. I'm sure this is simple, but I just can't seem to figure it out. I'm using the tree menu style and wondering how I go about changing the color of the "+" & "-" symbols. They are currently black and my background is also black so you can't really see them. I'd like to change them to white if possible.

I have an alternate icon set for dark backgrounds on my website (can't give URL look in docs) -- look under random extra stuff category...

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

Link to comment
Share on other sites

Hi I?ve had the following contribution installed

http://www.oscommerce.com/community/contri...Article+Manager for the last 6 months or so, but as the sections now expanded the navigations becoming increasing messy and I really need to find a solution before the problem gets any worse!

 

When doing a general search I luckily came across your support pages, but your script has been written to work only for the categories (CPATH) section of the site! I would really appreciate any support you can offer to help me convert your script to work for the ?articles manager? (TPATH)!

 

Thanks a lot!

Link to comment
Share on other sites

I have an alternate icon set for dark backgrounds on my website (can't give URL look in docs) -- look under random extra stuff category...

 

i went on your website have look at your demo page , but didnt found the set for dark backgrounds , it s still dark on the + , could you pm the link ?

MS2

Link to comment
Share on other sites

i went on your website have look at your demo page , but didnt found the set for dark backgrounds , it s still dark on the + , could you pm the link ?

 

 

Ya I couln't find anything either but ended up using photoshop to modify the "+" & "-" symbols. I didn't realize that these were images included with the contrib. I changed them all to the same color as the lines. Works well and looks good!

Link to comment
Share on other sites

When doing a general search I luckily came across your support pages, but your script has been written to work only for the categories (CPATH) section of the site! I would really appreciate any support you can offer to help me convert your script to work for the ?articles manager? (TPATH)!

Natch - it's a script for the categories menu and not for third-parth contribs ;)

 

Changing it to work with another parent/child type structure, would really just be a matter of changing the Dbase query round line 235 and changing the output of the tep_make_cat_branch function... Unfortunately I do not know more about that contrib to offer more detailed advice...

i went on your website have look at your demo page , but didnt found the set for dark backgrounds , it s still dark on the + , could you pm the link ?

Check the top menu -> pn/xaraya/osc -> downloads -> "random extra stuff" category. There a DL entitled: "DynaMenu Inverse Tree Menu Images"

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

Link to comment
Share on other sites

FYI, a repacked Dynamenu (v 1.11)has been uploaded which includes the missing tree menu images, tree_expand_corner_first.gif & tree_collapse_corner_first.gif.

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

Link to comment
Share on other sites

Great contribution - I've got it installed on my website that's about to go live - but had a question....

 

How could I go about limiting the menu to only display 1 level of submenus? I'd like the menu to display all main categories, and allow visitors to navigate only 1 level deep via the menu and then use category buttons from there.

 

Thanks for your help!

Link to comment
Share on other sites

How could I go about limiting the menu to only display 1 level of submenus? I'd like the menu to display all main categories, and allow visitors to navigate only 1 level deep via the menu and then use category buttons from there.

Haven't tested it, but you should be able to change:

$categories_string = tep_make_cat_dmlist();

to:

$categories_string = tep_make_cat_dmlist(0,X);

Where X is the maximum level of categories you want to build...

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

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