opencms

linklist.jsp

<%@ page session="false" import="java.text.SimpleDateFormat,java.util.Date"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"%>


测试新闻列表页


   
 

 

 

 <% String strPath=request.getRequestURL().subSequence(0,request.getRequestURL().indexOf("/sites"))+(pageContext.getAttribute("path").toString()); %>
 " target="_blank">
 
   



       

 

link.xsd


       
           
                       
       

       
   

   
       
           
           
           
               
           

  
    
    
  

        

   

 

 

leftNav.jsp

<%@ page language="java" import="java.util.*,org.opencms.jsp.*" pageEncoding="UTF-8"%>
<%
    CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
    List list = cms.getNavigation().getSiteNavigation("/sites/synnex/",10);
    String strNbsp = "    ";
    String path = "";
    Iterator iterator = list.iterator();
    while(iterator.hasNext()){     
     CmsJspNavElement ne = (CmsJspNavElement)iterator.next();
     
     path = ne.getResourceName();
     if('/' == path.charAt(0)){
      path = path.substring(1);
     }
     if('/' == path.charAt(path.length()-1)){
      path = path.substring(0,path.length()-1);
     }
     int depth = path.split("/").length;
     
     
     //out.println(ne.getResourceName());
     out.println("

");
     
     for(int i = 0; i < depth-3; i++){
      out.print(strNbsp);
     }
     
     out.println(ne.getNavText());
     out.println("

");
     
    }
%> 

你可能感兴趣的:(opencms)