Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2012
    Posts
    18
    Plugin Contributions
    0

    Default Changing tpl_drop_menu.php or mega_menu.php

    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

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Changing tpl_drop_menu.php or mega_menu.php

    Quote Originally Posted by fabburl View Post
    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
    Each type of item to be added to a menu bar has some sort of divider, whether it is levels, or whatever. One would need to back up to the area where the current menu "headings" are and use the code desired to get the "first level" and create by loop the header "buttons" desired. Then each second level item would be off of that first. The only thing of concern is, how many are you going to try to setup across the top (or will it be down the side) and what are you going to do to prevent either squishing them all in, or if hidden/deleted to not have your site get totally rearranged?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Changing tpl_drop_menu.php or mega_menu.php

    There are support threads for the various dropdown/megamenu mods, and at least some of them have discussions on exactly how to give that particular menu top category tabs in the header. I suggest you look up the one you are interested in for more detailed information.

  4. #4
    Join Date
    Sep 2012
    Posts
    18
    Plugin Contributions
    0

    Default Re: Changing tpl_drop_menu.php or mega_menu.php

    Quote Originally Posted by gjh42 View Post
    There are support threads for the various dropdown/megamenu mods, and at least some of them have discussions on exactly how to give that particular menu top category tabs in the header. I suggest you look up the one you are interested in for more detailed information.
    would you be able to direct me to some threads? I searched quite a bit before posting and got exasperated so I posted here.

    thanks.

  5. #5
    Join Date
    Jul 2009
    Location
    picaflor-azul.com
    Posts
    6,930
    Plugin Contributions
    45

    Default Re: Changing tpl_drop_menu.php or mega_menu.php

    Quote Originally Posted by fabburl View Post
    would you be able to direct me to some threads? I searched quite a bit before posting and got exasperated so I posted here.

    thanks.
    This question has already been asked and answered a few times. You can use the alternate categories ul generator file from the CSS Horizontal Dropdown Menu With jquery module to show the top level categories.

    Thanks,

    Anne

  6. #6
    Join Date
    Sep 2012
    Posts
    18
    Plugin Contributions
    0

    Default Re: Changing tpl_drop_menu.php or mega_menu.php

    Quote Originally Posted by picaflor-azul View Post
    This question has already been asked and answered a few times. You can use the alternate categories ul generator file from the CSS Horizontal Dropdown Menu With jquery module to show the top level categories.

    Thanks,

    Anne
    I've done this but what I seem to be getting are the submenus displaying immediately without hovering over. I've put a screenshot in if that helps

    Name:  navigationheader.jpg
Views: 134
Size:  23.0 KB

  7. #7
    Join Date
    Jul 2009
    Location
    picaflor-azul.com
    Posts
    6,930
    Plugin Contributions
    45

    Default Re: Changing tpl_drop_menu.php or mega_menu.php

    Quote Originally Posted by fabburl View Post
    I've done this but what I seem to be getting are the submenus displaying immediately without hovering over. I've put a screenshot in if that helps

    Name:  navigationheader.jpg
Views: 134
Size:  23.0 KB
    You will need to add the menu styles to hide the menus until hovered on. Compare the stylesheet with the CSS Horizontal Dropdown Menu With jquery module to the template menu stylesheet.

    Thanks,

    Anne

 

 

Similar Threads

  1. v154 application/x-httpd-php html_header.php PHP script text
    By Parafanaylya in forum General Questions
    Replies: 3
    Last Post: 29 Aug 2015, 03:06 PM
  2. Replies: 4
    Last Post: 17 Jul 2015, 04:44 AM
  3. Changing /admin/admin.php to somethingelse.php
    By liderbug in forum General Questions
    Replies: 1
    Last Post: 25 May 2012, 09:12 PM
  4. Linking Page_2.php, Page_3.php, Page_4.php In Footer
    By gws76 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 May 2007, 10:59 PM
  5. changing index.php to store.php
    By jford in forum General Questions
    Replies: 1
    Last Post: 6 Oct 2006, 04:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR