Development of dynamic navigation in opencms

Source: Internet
Author: User

Through APIs provided by opencms, you can easily implement the dynamic navigation function, provided that you set the navigation attributes of resources, such as operations:

"Navigation text" sets the text of the resource in the navigation, "insert it" sets the position of the navigation in the navigation list.

The followingCodeThis is an example of the alkacon document. After a slight modification, you can view the file to obtain the navigation list that has been added to all resources in the current directory.

<% @ Page Import = " Java. util .* "   %> <%

Org. opencms. jsp. cmsjspactionelement CMS =   New Org. opencms. jsp. cmsjspactionelement (pagecontext, request, response );

// Create navigation for all subfolders and pages in the current file folder
List list = CMS. getnavigation (). getnavigationforfolder ();
Iterator I = List. iterator ();

Out. println ( " <H3> A simple navigation " );
While (I. hasnext ()) ... {
Org. opencms. jsp. cmsjspnavelement ne=(Org. opencms. jsp. cmsjspnavelement) I. Next ();
Out. println ("<li> <a href =/" "+ cms. Link (ne. getresourcename () +"/"> ");
Out. println (ne. getnavtext ()+ "</A> </LI>");
}
Out. println ( " </Ul> " );
%>

The browsing effect is as follows:

Thank you for choosing opencms-the first blog in Chinese resources. You are welcome to directly communicate with the author and make progress together. MSN: qianxuncms@hotmail.com, QQ: 9165456.

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.