Originally Posted by
fabburl
Okay, right now if you go to, say, the Sheffield Blue (by Picaflor, can be found by search) theme in the navigation menu you get Shop which drops down and gives you all the categories and sub categories. This is not a question about Sheffield Blue in particular but about any template which uses a similar combination of a drop_menu or mega_menu and then uses a categories_ul_generator.php file
How can I make it so that instead of something like Shop -> Main Categories Dropdown -> Subcategories Dropdown I get the Main Categories in the navigation header itself directly and not underneath a title like "Shop".
The code I am working with works like this
<!--Categories Link in Menu-->
<?php
$cat_query = "select * from ".DB_PREFIX."categories where categories_status='1' ORDER BY RAND() LIMIT 1";
$category = $db->Execute($cat_query);
$categories_id=$category->fields['categories_id'];
?>
<li id='store'><a href="<?php echo zen_href_link(FILENAME_DEFAULT."&cPath=".$categories_id); ?>"><?php echo HEADER_TITLE_CATEGORIES; ?></a>
<?php
// load the UL-generator class and produce the menu list dynamically from there
require_once (DIR_WS_CLASSES . 'categories_ul_generator.php');
$zen_CategoriesUL = new zen_categories_ul_generator;
$menulist = $zen_CategoriesUL->buildTree(true);
$menulist = str_replace('"level4"','"level5"',$menulist);
$menulist = str_replace('"level3"','"level4"',$menulist);
$menulist = str_replace('"level2"','"level3"',$menulist);
$menulist = str_replace('"level1"','"level2"',$menulist);
$menulist = str_replace('<li class="submenu">','<li class="submenu">',$menulist);
$menulist = str_replace("</li>\n</ul>\n</li>\n</ul>\n","</li>\n</ul>\n",$menulist);
echo $menulist;
?>
</li>
<!--Categories Link in Menu Ends-->
Thanks
Bookmarks