Arien Posted August 31, 2003 Share Posted August 31, 2003 ok (why isn't there an edit post button :() i fixed that problem aswell but i'm stuck trying to make the text in the buttons centered in the middle vertically. Quote Link to comment Share on other sites More sharing options...
cindyd Posted September 2, 2003 Share Posted September 2, 2003 Thank you Jose for posting this! I just wish I had started reading backwards from page 33. Ok.. first of all i'am a newbie.. i just install and did everything as the instruction told me so, the only problem i ran into is the Menu seem to Float on other box.. everything came out right but i can't seem to make the Menu fit into the Categorie box .. HELPP THIS NEWBIE PLEASEEEEEEE Please read this post to see a solution: http://www.oscommerce.com/forums/viewtopic.php...tart=290#217634 The file you have to edit is catalog/includes/coolmenu.php. Look for the line that says: $height.= 2.65*count($categories); That's were you have to include the code from the link above. Good luck! Quote Link to comment Share on other sites More sharing options...
defender39 Posted September 2, 2003 Share Posted September 2, 2003 THis contrib is awesome and works really well... It should be added to the OSC release with an admin option for On/Off. Quote Link to comment Share on other sites More sharing options...
Arien Posted September 2, 2003 Share Posted September 2, 2003 Anyone got any idea how to center the text vertically in the rows? I tried in the CSS but it didn't work and it's anoying me now. Quote Link to comment Share on other sites More sharing options...
Nils P. Posted September 2, 2003 Share Posted September 2, 2003 Anyone got any idea how to center the text vertically in the rows? I tried in the CSS but it didn't work and it's anoying me now. Yepp, the css file is the right place. Search for this entry: .clLevel0{ background-color:#ffffff; layer-background-color:#ffffff; color:#000000; } you could either add text-align: center; or padding-left: 30px; (or some other number) If you want to do the same for subcategories, the entry to look for is: .clLevel1, .clLevel1over Good luck, Nils Quote My wee Contribs: Include Subcats | Shopping Cart Box | Category Box Link to comment Share on other sites More sharing options...
Arien Posted September 2, 2003 Share Posted September 2, 2003 Nils that will align the text in the center horizontaly.. i'm talking about vertically.. like top middle bottom.. at the moment to text is default onthe top.. but because this isn't HTML i don't know how to align it into the middle. Quote Link to comment Share on other sites More sharing options...
Nils P. Posted September 2, 2003 Share Posted September 2, 2003 Nils that will align the text in the center horizontaly ..oops sorry, I didn't read. Try padding-top: 10px then (or some other number). And I forgot to mention that you have to do the same for the "over" entries, i.e. if you change something in .clLevel0 you should change it in .clLevel0over as well (it's what it looks like "on mouse over") Nils Quote My wee Contribs: Include Subcats | Shopping Cart Box | Category Box Link to comment Share on other sites More sharing options...
Arien Posted September 2, 2003 Share Posted September 2, 2003 thank you! works perfectly now :D. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 I just experiment a problem with cool menu the menu excede the box over the other box, why do the cool menu box do not adjust by itself? write me back here or at [email protected] it will be appreciated here attached a image [/img] Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 also i cant see the arrow image but this is less important then the overlapping, please HELP ME Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 .... Quote Link to comment Share on other sites More sharing options...
Arien Posted September 3, 2003 Share Posted September 3, 2003 the answer is only a few pages back.. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 Hi, I'm using Coolmenu 1.2 and it works great. Just one question. The menu opens rather quickly when a page is still downloading. As a result, you can see pretty much a "blank page", but the menu is there. Is there a way that I can get it to display once the page is more fully drawn or close to completion? Thanks, Mark Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 yes but how much page back, i check it and not found Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 Hi. Not sure of your question. In short the menu is shown too quickly - it is shown while page is being "drawn". On a fast internet link it may not be so obvious. On a slow one, you can see the menu "before" the page has finished loading. I need to delay it's appearance ... Thanks, Quote Link to comment Share on other sites More sharing options...
Guest Posted September 3, 2003 Share Posted September 3, 2003 I am trying to install the coolmenu -- but, I have the basic template contribution installed. Has anyone else tried this? If so, can you give any assistance. Anne Quote Link to comment Share on other sites More sharing options...
jlramirez Posted September 3, 2003 Share Posted September 3, 2003 yes but how much page back, i check it and not found Page 32, or you could click this: http://www.oscommerce.com/forums/viewtopic.php...tart=310#220529 Quote Link to comment Share on other sites More sharing options...
Nils P. Posted September 3, 2003 Share Posted September 3, 2003 What i did to make it fully autoadjust is just add these three lines (substituting the original line: $height.= 2.65*count($categories)) //With this line i read the top categories $categories_query = tep_db_query("select count(*) as count_top_categories from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); //i grab the array (actually its only one value, but i'm too lazy right now //to check if there is a function to grab only one value in the API $count_top_categories = tep_db_fetch_array($categories_query); //I multiply by 28(pixels) the number of top categories there are $height.= 28*$count_top_categories['count_top_categories']; jlramirez, your method adds an extra database quary, but none is needed. There's a faster and easier way, that has been documented in this thread too: here's my version of it (catalog/includes/coolmenu.php): $categories = tep_get_categories(''); $height = -21; $depth=0; $blank_length; $depth_size; $depth_parentid; for($i=0; $i<count($categories); $i++) { // don't insert 1st entry ("please choose ...") $blank_length = blank_length($categories[$i]['text']); if($blank_length == $depth) { $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length > $depth) { $depth++; $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length < $depth) { for ($j=$depth; $j>$blank_length; $j--) { $depth_size[$j] = 0; $depth--; } $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } $depth_parentid[$categories[$i]['depth']] = $categories[$i]['id']; // remove blanks $categories[$i]['text'] = substr($categories[$i]['text'], 12*$blank_length); if ($depth == 0) { $height += 17; // use oCMenu.level[0].height + 1 !! } print_menu_line($categories[$i], $depth_size,$depth_parentid, $depth); } Comments: $height = -21; //I don't know why -21, but i found out it works for me. maybe someone can explain? if ($depth == 0) //then it's a top level category, no db query needed $height += 17; // use what you took as oCMenu.level[0].height + 1 !! plus one because of the border For me, the above code works perfectly for all numbers of categories and all sizes of oCMenu.level[0].height . Nils Quote My wee Contribs: Include Subcats | Shopping Cart Box | Category Box Link to comment Share on other sites More sharing options...
jlramirez Posted September 3, 2003 Share Posted September 3, 2003 What i did to make it fully autoadjust is just add these three lines (substituting the original line: $height.= 2.65*count($categories)) //With this line i read the top categories $categories_query = tep_db_query("select count(*) as count_top_categories from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); //i grab the array (actually its only one value, but i'm too lazy right now //to check if there is a function to grab only one value in the API $count_top_categories = tep_db_fetch_array($categories_query); //I multiply by 28(pixels) the number of top categories there are $height.= 28*$count_top_categories['count_top_categories']; jlramirez, your method adds an extra database quary, but none is needed. There's a faster and easier way, that has been documented in this thread too: here's my version of it (catalog/includes/coolmenu.php): $categories = tep_get_categories(''); $height = -21; $depth=0; $blank_length; $depth_size; $depth_parentid; for($i=0; $i<count($categories); $i++) { // don't insert 1st entry ("please choose ...") $blank_length = blank_length($categories[$i]['text']); if($blank_length == $depth) { $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length > $depth) { $depth++; $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length < $depth) { for ($j=$depth; $j>$blank_length; $j--) { $depth_size[$j] = 0; $depth--; } $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } $depth_parentid[$categories[$i]['depth']] = $categories[$i]['id']; // remove blanks $categories[$i]['text'] = substr($categories[$i]['text'], 12*$blank_length); if ($depth == 0) { $height += 17; // use oCMenu.level[0].height + 1 !! } print_menu_line($categories[$i], $depth_size,$depth_parentid, $depth); } Comments: $height = -21; //I don't know why -21, but i found out it works for me. maybe someone can explain? if ($depth == 0) //then it's a top level category, no db query needed $height += 17; // use what you took as oCMenu.level[0].height + 1 !! plus one because of the border For me, the above code works perfectly for all numbers of categories and all sizes of oCMenu.level[0].height . Nils Exactly!!, when i wrote my hack i was in such a hurry that i didn't even notice what the for() was (or at least i don't remember giving it a look). And it is exactly what i was looking for, a way to tell how many top-level categories there are, and of course if($depth == 0).... duh!!. Well i'm very sorry for that sorry piece of code. I'll have to link yours when someone else asks the same question. Is there a FAQ/Tips and Tricks for this one, its asked quite frequently. Cheers!!! Quote Link to comment Share on other sites More sharing options...
Guest Posted September 4, 2003 Share Posted September 4, 2003 What i did to make it fully autoadjust is just add these three lines (substituting the original line: $height.= 2.65*count($categories)) //With this line i read the top categories $categories_query = tep_db_query("select count(*) as count_top_categories from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); //i grab the array (actually its only one value, but i'm too lazy right now //to check if there is a function to grab only one value in the API $count_top_categories = tep_db_fetch_array($categories_query); //I multiply by 28(pixels) the number of top categories there are $height.= 28*$count_top_categories['count_top_categories']; jlramirez, your method adds an extra database quary, but none is needed. There's a faster and easier way, that has been documented in this thread too: here's my version of it (catalog/includes/coolmenu.php): $categories = tep_get_categories(''); $height = -21; $depth=0; $blank_length; $depth_size; $depth_parentid; for($i=0; $i<count($categories); $i++) { // don't insert 1st entry ("please choose ...") $blank_length = blank_length($categories[$i]['text']); if($blank_length == $depth) { $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length > $depth) { $depth++; $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length < $depth) { for ($j=$depth; $j>$blank_length; $j--) { $depth_size[$j] = 0; $depth--; } $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } $depth_parentid[$categories[$i]['depth']] = $categories[$i]['id']; // remove blanks $categories[$i]['text'] = substr($categories[$i]['text'], 12*$blank_length); if ($depth == 0) { $height += 17; // use oCMenu.level[0].height + 1 !! } print_menu_line($categories[$i], $depth_size,$depth_parentid, $depth); } Comments: $height = -21; //I don't know why -21, but i found out it works for me. maybe someone can explain? if ($depth == 0) //then it's a top level category, no db query needed $height += 17; // use what you took as oCMenu.level[0].height + 1 !! plus one because of the border For me, the above code works perfectly for all numbers of categories and all sizes of oCMenu.level[0].height . Nils Exactly!!, when i wrote my hack i was in such a hurry that i didn't even notice what the for() was (or at least i don't remember giving it a look). And it is exactly what i was looking for, a way to tell how many top-level categories there are, and of course if($depth == 0).... duh!!. Well i'm very sorry for that sorry piece of code. I'll have to link yours when someone else asks the same question. Is there a FAQ/Tips and Tricks for this one, its asked quite frequently. Cheers!!! but where to put this code this code replace wha, it is possible for anyone to post is full coolmenu.php modified with this code and that works thanks! Quote Link to comment Share on other sites More sharing options...
sinbad Posted September 4, 2003 Share Posted September 4, 2003 Can someone tell me if you can place and external link inside coolmenu using sub-catagories and if so how. The shop is set up for regular ecommerce transactions however this would be the only catagory that would need external linking. Business Services >Telecomm ..............................>Hosting Telecom and hosting would link directely to another site. Quote Sinbad "Mine is not the only way, mine is just another way Link to comment Share on other sites More sharing options...
Nils P. Posted September 4, 2003 Share Posted September 4, 2003 Can someone tell me if you can place and external link inside coolmenu using sub-catagories and if so how. Hi, page 33 is your friend. :wink: http://www.oscommerce.com/forums/viewtopic.php...r=asc&start=320 Nils Quote My wee Contribs: Include Subcats | Shopping Cart Box | Category Box Link to comment Share on other sites More sharing options...
sinbad Posted September 5, 2003 Share Posted September 5, 2003 Thank Nils P, however I found my answer in another area thanks to Seafire and Maxidvd, In the index.php around line 16 require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { //add here if ( $cPath == '50_52' ) //change '50_52' to your cpath for category { header( 'Location: http://www.sitename.com' ); exit; } This also works for more than one link just place the same lines below and edit as needed and so on. I just need to find out how to open this in a new window. Quote Sinbad "Mine is not the only way, mine is just another way Link to comment Share on other sites More sharing options...
Sketchy Posted September 5, 2003 Share Posted September 5, 2003 I have a flash movie on my homepage. When I use 'coolmenu', parts of the menu do not display properly because the flashmovie overlaps them. Can anybody suggest a solution? Quote Link to comment Share on other sites More sharing options...
lethalray Posted September 6, 2003 Share Posted September 6, 2003 hi there Im having some trouble with the coolmenu. http://www.fluxmind.dyns.net/~flux/catalog/ As you can see it floats above the page. I have finished reading thru these 35 pages and made two changes: the code by Nils for auto positioning. and the JS_NO_JS contrib for coolmenu by Marc Zacher however that doesnt seem to help as there is no categories box in the first place. Ive tried moving the code in the body part around to see if it will fit inside the left column but it doesnt seem to . It takes its own space and everything else becomes above or below it. Any and all help is honestly appreciated. Thankyou for your time Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.