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.