helius Posted June 14, 2009 Report Share Posted June 14, 2009 hi, i have tryed alot of different things to include a dynamic menu script into the xtc_show_category.inc.php, but i kinda fail doing it :'( i am running the xt commerce version v3.0.4SP2.1 and i am trying to include this dynamic menu http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/. Would be greate if some one could help me big thx Link to comment Share on other sites More sharing options...
thomasruta Posted June 29, 2009 Report Share Posted June 29, 2009 Hallo, sitze an dem gleichen Problem... dynamisches Menü von Jquery CSS Multi level Menu (Vertical) | JavaScript Menus | Hot Scripts Wir angezeigt wenn du in der xtc_show_category.inc.php ab Zeile 32 ff einbaust <div id="myslidemenu" class="jqueryslidemenu"> // Wenn das erste Element wird die Body-Box und eine float-Box geöffnet if ($foo[$counter]['level']=='') { if (strlen($categories_string)=='0') { $categories_string .= '<div class="floatbox"><div id="myslidemenu" class="jqueryslidemenu">'; } } [/PHP] Dann in der header einfügen: [PHP]// dynamic Categories ?>" /> <link rel="stylesheet" type="text/css" href="menu/menu.css"> <script language="javascript" src="menu/jquery-1.2.6.js"></script> <script language="javascript" src="menu/menu.js"></script> <? // dyn Cat ends ?>[/PHP] Dann funktioniert das schon - jedoch versuche ich gerade die gesamten Kategorien in einer strukturierten Liste auszugeben und nicht nur die aktive... Wie kann ich alle Kategorien rekursiv ausgeben? Das klappt noch nicht :-( Viele Grüße Thomas Link to comment Share on other sites More sharing options...
thomasruta Posted June 29, 2009 Report Share Posted June 29, 2009 in der categories.php habe ich noch folgendes ergänzen müssen: $categories_query = xtDBquery($categories_query); $ii = 0; while ($categories = xtc_db_fetch_array($categories_query, true)) { $foo[$categories['categories_id']] = array ('name' => $categories['categories_name'], 'parent' => $categories['parent_id'], 'level' => 0, 'path' => $categories['categories_id'], 'next_id' => false); if (isset ($prev_id)) { $foo[$prev_id]['next_id'] = $categories['categories_id']; } $prev_id = $categories['categories_id']; if (!isset ($first_element)) { $first_element = $categories['categories_id']; } $ids[$ii]= $categories['categories_id']; $ii++; } //------------------------ //if ($cPath) { /*$new_path = ''; $id = split('_', $cPath); reset($id);*/ for($ii = 0; $ii < count($ids); $ii++) { $key=0; $value = $ids[$ii]; unset ($prev_id); unset ($first_id); $categories_query = "select c.categories_id, cd.categories_name, c.parent_id from ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where c.categories_status = '1' and c.parent_id = '".$value."' ".$group_check." and c.categories_id = cd.categories_id and cd.language_id='".$_SESSION['languages_id']."' order by sort_order, cd.categories_name"; //print $categories_query; $categories_query = xtDBquery($categories_query); $category_check = xtc_db_num_rows($categories_query, true); if ($category_check > 0) { $new_path .= $value; while ($row = xtc_db_fetch_array($categories_query, true)) { $foo[$row['categories_id']] = array ('name' => $row['categories_name'], 'parent' => $row['parent_id'], 'level' => $key +1, 'path' => $new_path.'_'.$row['categories_id'], 'next_id' => false); if (isset ($prev_id)) { $foo[$prev_id]['next_id'] = $row['categories_id']; } $prev_id = $row['categories_id']; if (!isset ($first_id)) { $first_id = $row['categories_id']; } $last_id = $row['categories_id']; } $foo[$last_id]['next_id'] = $foo[$value]['next_id']; $foo[$value]['next_id'] = $first_id; $new_path .= '_'; } else { //break; } } //} [/PHP] Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.