Example of Freemarker level 3 menu effects

Source: Internet
Author: User
Tags php framework

Background

The code is as follows Copy Code
Hashmap<string, object> map= new hashmap<string, object> ();
Top Menu
List<dedearctypes> toplist=testservice.finddedearctypes (Topid,reid,typeid, "topid");
Second Level menu
for (Dedearctypes dedearctypes1:toplist) {
System.out.println ("Level menu" +dedearctypes1.gettypename ());
List<dedearctypes> reidlist1=testservice.finddedearctypes (Topid,dedearctypes1.getid (), typeID, "Reid");

Map.put (Dedearctypes1.getid () + "", reidlist1);
for (Dedearctypes Dedearctypes2:reidlist1) {
System.out.println ("Level Two menu" +dedearctypes2.gettypename ());
List<dedearctypes> reidlist2=testservice.finddedearctypes (Topid,dedearctypes2.getid (), typeID, "Reid");
Map.put (Dedearctypes2.getid () + "", reidlist2);
for (Dedearctypes dedearctypes3:reidlist2) {
System.out.println ("Level Three menu" +dedearctypes3.gettypename ());
}
}
}

Console printing

Level Menu It technology
Level two menu PHP development
Level Three menu PHP getting Started
three level menu PHP function
Three level menu PHP Framework
Three level menu PHP interface
Three level menu PHP information
Two level menu Java development
Level Three menu Java Basics
Level three menu Javaweb
Level Three menu Java Framework
Three level menu Java design mode
three level menu Java interview
three level menu Java algorithm
Two level menu Linux Tutorial
Two level menu C development
Level Two menu C + +
Level two menu other development
Level two menu database development
Three level menu SQL Server
Three level menu Oracle
Three level menu MySQL
level menu life Navigation
Two level menu smile at Life
Level three menu comedy men and women jokes
Level Three menu Cold jokes
Three level menu original
Three level menu Social
Three level menu humor joke
Two level menu inspirational life
Three level menu inspirational article
three level menu inspirational story
Three level menu life feeling
Level three menu Classic quotes
Level three menu workplace motivational
Three menu youth-inspiring
Three-level menu for Life
Three-level menu motivational speech
Three level menu classic American
Three level menu inspirational slogan
Three level menu inspirational Education
Two level menu entrepreneurial life
The second level menu food life
Level two menu game Life
Two level menu career life
Two level menu history life
Two level menu travel life
Two level menu reading life
Level menu Marketing Tools
Two level menu SEO optimization technology
Three level menu SEO Tutorial
Level three menu SEO optimization
Level three menu SEO case
Three level menu SEO terminology
Three level menu SEO FAQ
Two level menu QQ
Two level menu Micro letter
Two level menu microblogging
level menu Help document
Two level menu paper
The second Level menu composition
Level two menu Qualification examination
level menu Grade Life
Level two menu tea culture
Two vegetables cycling culture
Two level menu mobile culture
Two level menu music culture
Two level menu company culture
 

<!--home-->

The code is as follows Copy Code
< #assign x = 0>
< #if toplist?exists>
< #list Toplist as list>

<li class= "Dropdown < #if list_index+1 = 1>active </#if >" >
<a href= "javascript:void (0);" class= "Dropdown-toggle" data-toggle= "dropdown" >
${list.typename}
</a>
<ul class= "Dropdown-menu" >

< #list Map?keys as mkey>

< #if list.id?string = mkey>
< #assign x=x+1>

< #if x = = 1>
< #assign item = map[mkey]>
< #list item as Itemvalue>
<!--one Page-->
<li class= "Dropdown-submenu" >
<a href= "javascript:void (0);" >${itemValue.typename}</a>
< #assign subitem = map[itemvalue.id?string]>
< #if map[itemvalue.id?string]?? && map[itemvalue.id?string]?size GT 0 >
<ul class= "Dropdown-menu" >
< #list subitem as subitemvalue>
<li><a href= "${url}/menu/${subitemvalue.typedir}" >${subItemValue.typename}</a></li>
</#list >
</ul>
</#if >

</li>
<!--end one Page-->
</#list >
</#if >

< #if x!= 1>
< #assign item = map[mkey]>
< #list item as Itemvalue>
<!--one Page-->
<li class= "Dropdown-submenu" >
<a href= "javascript:void (0);" >${itemValue.typename}</a>
< #assign subitem = map[itemvalue.id?string]>
< #if map[itemvalue.id?string]?? && map[itemvalue.id?string]?size GT 0 >
<ul class= "Dropdown-menu" >
< #list subitem as subitemvalue>
<li><a href= "${url}/menu/${subitemvalue.typedir}" >${subItemValue.typename}</a></li>
</#list >
</ul>
</#if >

</li>
<!--end one Page-->
</#list >
</#if >


</#if >

</#list >


</ul>
</li>

</#list >
</#if >



<!--end Home-->
Level three Menu

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: [email protected] 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.