Jump to content
Sign in to follow this  
fear4me

CSS Menu

Recommended Posts

anyone know how to disable the link (a href) for the main category? my products does not add often and its bad for customer when click on the main category to see the same products again and again. I simply want the customer to go direct to the product page!

Share this post


Link to post
Share on other sites

I reworked the queries used in the contribution.

The total menu works with just a few (3-5) queries with a huge pageload improvement.

 

I went from 6 seconds to around 0,5 second.

Share this post


Link to post
Share on other sites

Hi there,

i'm getting the following after installing the latest update (the optimized one) :

Warning: Invalid argument supplied for foreach() ...

includes\boxes\categories_css.php on line 250

and also 256

Anyone ?

Tx

Fab


Advice on forum are Free, Email or Pm to fix your site is work...which I charge for :)

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

Share this post


Link to post
Share on other sites

Hi

I have just tried installing this menu contribution. Feel most frustrated because it is stated a very simple to get working, but not for me!

 

I get the following appearing on my page:

 

0 ) { $returnval .= "

"; } if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) { $productsDisplay=$cssMenuConfig['maxProductsInMenu']; $addMore= true; } $count_string = ''; if (SHOW_COUNTS == 'true') { if ($totalitemsincategory > 0) { $count_string = ' (' . $totalitemsincategory . ')'; } } $i=0; while ($i < $productsDisplay) { $products = tep_db_fetch_array($products_query); $product_query = tep_db_query("select products_name from products_description where products_id = " . $products['products_id'] . " AND language_id = ".$languageID ); $product = tep_db_fetch_array($product_query); $returnval .= "

".$product['products_name']."\n"; $i++; } if ( $addMore ) { $returnval .= "

".$cssMenuConfig['moreText']."\n"; } if ( $productsDisplay > 0 || !$includeul ) { $returnval .= "

"; } return $returnval; } function PrintSubMenus( $parentID, $languageID, $start_path ){ global $cssMenuConfig, $categories_subs, $categories_start; $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "

"; } else { $returnval .= "

"; $returnval .= ""; } // $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 = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); $cat_subs = Array(); foreach($categories_start as $key => $value) { if(strstr($key, '_' . $parentID)) { $cat_subs[$parentID][] = substr($key, 0, strpos($key, "_")); } } foreach ($cat_subs[$parentID] as $v) { //$categories = tep_db_fetch_array($categories_query) $categories = $categories_start[$v . '_' . $parentID]; if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); $totalitemsincategory = tep_count_products_in_category($categories['categories_id']); $count_string = ''; if ((SHOW_COUNTS == 'true') && ($totalitemsincategory > 0) ){ $count_string = ' (' . $totalitemsincategory . ')'; } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "".$categories['categories_name'].$count_string."\n"; } if (array_key_exists($categories['categories_id'], $categories_subs)) { //tep_has_category_subcategories($categories['categories_id']) $returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path ); if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, false, $languageID); } } else { if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, true, $languageID); } } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= ""; } } if ( !$cssMenuConfig['includeProducts'] ) { $returnval .= ""; } if ($parentID == 0) $returnval .= "

"; return $returnval; } function cssMenu_ShowCategory( $switch, $products) { if ( $switch == 1 ) { return true; } else { if ($products > 0) { return true; } else { return false; } } } ?> Categories

 

Fatal error: Call to undefined function PrintSubMenus() in C:\Web\WebServer\Apache2\htdocs\catalog\includes\boxes\categories_css.php on line 315

 

Any ideas?

Kind Regards

Garry

Share this post


Link to post
Share on other sites

I just installed CSS Menu 0.4 Update and am getting the following error:

 

1146 - Table 'testing.categories_descriptionn' doesn't exist

 

select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_descriptionn cd where c.categories_id = cd.categories_id and cd.language_id = '1' order by sort_order, cd.categories_name

 

[TEP STOP]

 

I followed the instructions and edited the two files directing to categories_css.php. CSS Menu v0.3 works fine. v0.4 is giving the above error.

Share this post


Link to post
Share on other sites

I see I made a mistake in the included file.

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

Should be:

$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.categories_id = cd.categories_id and cd.language_id = '" . $languages_id ."' order by sort_order, cd.categories_name");

Edited by DarkFire

Share this post


Link to post
Share on other sites

I now know why the new menu with less database queries didnt work.

In column_left.php I have this line:

  if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories_css.php');
 }

 

that will make the menu totally bugged as soon as you cache the menu (after the first click on the site) But the new menu is extremely much faster so I dont really have to use the if statement.

Share this post


Link to post
Share on other sites

That's strange though cause I used the menu including cache too and then it still worked but like you said, the cache isn't really needed.

Share this post


Link to post
Share on other sites

i know few about js, so is there anyone knows how to keep the path highlighted after move the mouse over the parent categories to the subcategories????

Share this post


Link to post
Share on other sites

ive tired so many times i cant install

this css menu

its a really pain nothing works

 

www.kewns.co.uk

 

if you can give any help iwould be gratful thank you

 

cheers

ste

Share this post


Link to post
Share on other sites
ive tired so many times i cant install

this css menu

its a really pain nothing works

 

www.kewns.co.uk

 

if you can give any help iwould be gratful thank you

 

cheers

ste

 

Honestly I finally got frustrated with it and decided to use a smaller simpler CSS Menu and have my programmer start working on it. I'll post it as a contribution when its done but the idea is to take this MUCH LIGHTER CSS MENU and its cleaner and make it a stand alone that can operate as a menu on any page with dynamic oscommerce data and work in oscommerce too. If it works like I know it will I'll have him then take the menu manager he did for open-realty which is based on the Typo3 menu manager and make it work for osCommerce. Then with an admin based menu management you get to add what code is used for your menu markup.

 

I'll post more on it today on my blog. I just can't get this contribution to work even on a bare naked fresh install of oscommerce.

 

~ Jared


www.jaredritchey.com

Share this post


Link to post
Share on other sites

Has anyone been able to make custom links to other pages with this contribution?

 

I would like to link to internal pages like products_new.php and specials.php.

Share this post


Link to post
Share on other sites
Has anyone been able to make custom links to other pages with this contribution?

 

I would like to link to internal pages like products_new.php and specials.php.

 

You know there is a cleaner easier to use menu I have in my snippets DB but My PHP skills are not quite there and if anyone can comprehend the PHP for this CSS menu and alter it for my CSS Menu I know it will work cleaner and faster. This one WILL allow you to add items to custom pages or even custom links.

 

If anyone can step up and assist I'd be happy to get this rolling.

 

 

~ Jared


www.jaredritchey.com

Share this post


Link to post
Share on other sites

Yes I added custom links. As it was too complicated to mess about with the programming I just did this by creating a second copy of the menu as it indicated in the code. It was a bit tricky to get it working in I.E. but I finally managed it. It went something like this:

 

in categories_css.php

var menuids=["suckertree1","suckertree2"] //Enter id(s) of SuckerTree UL menus, separated by commas

 

Then near the bottom of the page for the second menu repeating the code about $info_box_contents, working from the example of the html generated by the original css menu, changing the links to tep_href_link and checking to see if the resulting code was correct.

 $info_box_contents[] = array('text' =>'<div class="suckerdiv"><ul id="suckertree2"><li>........

Share this post


Link to post
Share on other sites
Yes I added custom links. As it was too complicated to mess about with the programming I just did this by creating a second copy of the menu as it indicated in the code. It was a bit tricky to get it working in I.E. but I finally managed it. It went something like this:

 

in categories_css.php

var menuids=["suckertree1","suckertree2"] //Enter id(s) of SuckerTree UL menus, separated by commas

 

Then near the bottom of the page for the second menu repeating the code about $info_box_contents, working from the example of the html generated by the original css menu, changing the links to tep_href_link and checking to see if the resulting code was correct.

 $info_box_contents[] = array('text' =>'<div class="suckerdiv"><ul id="suckertree2"><li>........

 

Would you be able to post your whole categories_css.php file. I want to do the same thing but can't work out how.

 

Thanks,

 

Lyle

Share this post


Link to post
Share on other sites

If javascript is turned off in the browser preferences then this menu doesn't really work. Is there any way to get it to revert back to the original categories box or has someone come up with another solution?

 

Lyle

Share this post


Link to post
Share on other sites

Hi Guys,

 

Ive searched for several hours but I cant seem to find what I need, Im looking for something very very simple. Most of the drop-down menu's ive seen till now are Categories, Products, etc... what I need is a drop down menu for one of my navigation buttons in oscommerce (I know how that can be done in HTML, but I cant figure it out in PHP) - so a menu similar to the one on top of this page , thus if you put your mouse over 'Community' you would get a list of other links under it.

 

Any help, or redirection to a contribution would be extremely great & I would be grateful

 

Thanks

 

AJ

Share this post


Link to post
Share on other sites
Would you be able to post your whole categories_css.php file. I want to do the same thing but can't work out how.

 

Thanks,

 

Lyle

 

Thanks David for sending me the file. I have my menu working now and the code is below.

 

var menuids=["suckertree1","suckertree2","suckertree3"] //Enter id(s) of SuckerTree UL menus, separated by commas

 

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

//  new infoBoxHeading($info_box_contents, true, false);

 $info_box_contents = array();

 $info_box_contents[] = array('text' => //'<div class="suckerdiv"><ul id="suckertree3"><li><a href='.tep_href_link("index.php").'>Home</a></ul>' .
'<a ' . tep_image(DIR_WS_IMAGES . 'infobox/Pictures.jpg', 'Galleries') . '</a>'
. PrintSubMenus( 0, $languages_id, '' ). '<a ' . tep_image(DIR_WS_IMAGES . 'infobox/TravelInfob.jpg', 'Galleries') . '</a>'
. '<div class="suckerdiv"><ul id="suckertree2"><li><a href='.tep_href_link("Tips.php").'>Travel Tips</a><a href='.tep_href_link("Tips.php").'>Culture</a><a href='.tep_href_link("Tips.php").'>Language</a><a href='.tep_href_link("Tips.php").'>History</a></ul></div>');

 $info_box_contents[] = array('text' => '<div class="suckerdiv"><ul id="suckertree3"><li><a href='.tep_href_link("links.php").'>Links</a><ul><li><a href="http://www.lonelyplanet.com/" target="_blank">Lonely Planet</a></li><li><a href="http://www.danheller.com/" target="_blank">Dan Heller</a></li><li><a href='.tep_href_link("rss.php").'>RSS Feed</a></li></ul>');


//  $info_box_contents[] = array('text' => PrintSubMenus( 0, $languages_id, '' ));
//  $info_box_contents[] = array('align' => 'center',
//							  'text'  => '<a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');
//  $info_box_contents[] = array('align' => 'center',
//							   'text'  => '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '">' . BOX_SPECIALS_ALLPRODS . '</a>');
//  $info_box_contents[] = array('align' => 'center',
//							   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . BOX_WHATSNEW_ALLPRODS .'</a>');							   

 new infoBox($info_box_contents);

?>
		</td>
	  </tr>

<!-- MenuConfigategories_eof //-->

 

As I am using a picture for my header I commented out new infoBoxHeading.

 

Hopefully it's be helpful to someone.

Share this post


Link to post
Share on other sites

never mind I got it to work I followed the earlier directions,

Edited by Zekk

Share this post


Link to post
Share on other sites

Hi, I was looking at coolMenu and came across CSS Menu and I decided to choose this one instead.

When I was looking at a store with coolMenu running (http://www.geraeteland.de/shop/catalog/index.php) I noticed that the Subcategory cells had less padding than the main Category cells (go to the link to see what I mean). I was just wondering how that could be done in CSS Menu for each individual subcategory level? Basically I'll be having Categories -> Subcategories -> Sub-subcategories, and I want the Sub-subcategories to be thinner (so there's less chance of stretching the page down)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×