thinkcmf-Homepage Nav Section menu configuration detailed

Source: Internet
Author: User

The Nav menu code is placed on the/themes/simplebootx/public/nav.html

Specific code:

<?php$effected_id= "Main-menu";  $FILETPL = "<a href= ' \ $href ' target= ' \ $target ' >\ $label </a>";  $FOLDERTPL = "<a href= ' \ $href ' target= ' \ $target ' class= ' dropdown-toggle ' data-toggle= ' dropdown ' >\ $label <b class= ' caret ' ></b></a> ';  $ul _class= "Dropdown-menu";  $li _class= "";  $style = "NAV";  $showlevel =6;  $dropdown = ' dropdown ';  Echo Sp_get_menu ("main", $effected _id, $filetpl, $foldertpl, $ul _class, $li _class, $style, $showlevel, $dropdown);? >

where "main" means that you want to get a menu of all active 1 menus sorted under the main menu

function Sp_get_menu ($id = "main", $effected _id= "MainMenu", $filetpl = "<span class= ' file ' >\ $label </span>" , $foldertpl = "<span class= ' folder ' >\ $label </span>", $ul _class= "", $li _class= "", $style = "Filetree", $ showlevel=6, $dropdown = ' haschild ') {$navs =f ("site_nav_". $id); if (empty ($navs)) {$navs =_sp_get_menu_datas ($id);} Import ("Tree"); $tree = new \tree (); $tree->init ($navs); return $tree->get_treeview_menu (0, $effected _id, $ FILETPL, $FOLDERTPL,  $showlevel, $ul _class, $li _class,  $style,  1, FALSE, $dropdown);} function _sp_get_menu_datas ($id) {$nav _obj= M ("Nav"), $oldid = $id; $id = Intval ($id); $id = Empty ($id)? " Main ": $id, if ($id = =" Main ") {$navcat _obj= M (" Navcat "), $main = $navcat _obj->where (" active=1 ")->find ();//Pick out main Menu $ id= $main [' Navcid '];} if (empty ($id)) {return array ();}        ......}

$effected _id= "Main-menu" indicates the ID of the generated UL element

Thinkcmf-Homepage Nav Section menu configuration detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.