FW: [opencms-dev] How can make my own CmsXmlNav?[ path bar ]
Taras Vasylkevych
t.vasylkevych at inmedias.de
Sun Aug 3 12:04:02 CEST 2003
Hi,
if you use jsp templates, you could try something like this:
<%
// Create a JSP action element
com.opencms.flex.jsp.CmsJspActionElement cms = new
CmsJspActionElement(pageContext, request, response);
// Get the current folder name
String filename;
String targetframe = "_self";
filename = cms.getRequestContext().getUri();
com.opencms.file.CmsObject cmsObject = cms.getCmsObject();
String uri = cmsObject.getRequestContext().getUri();
CmsJspNavElement currentnav =
CmsJspNavBuilder.getNavigationForResource(cmsObject, uri);
int navlevel = currentnav.getNavTreeLevel();
for ( int curnavlevel =1; curnavlevel <= navlevel; curnavlevel++ ) {
// List of all pages / subfolders (sorted by NavPos property)
java.util.ArrayList list =
cms.getNavigation().getNavigationForFolder(curnavlevel);
if ( ! list.isEmpty() ) {
java.util.Iterator i = list.iterator();
while (i.hasNext()) {
CmsJspNavElement ne = (CmsJspNavElement)i.next();
if ( filename.indexOf(ne.getResourceName()) > -1 ) {
out.println("<a class=\"historie\" href=\"" +
cms.link(ne.getResourceName()) +
"\" target=\"" + targetframe + "\">" + ne.getNavText() +
"</a>");
}
}
}
%>
it works fine for me.
Best Regards,
Taras Vasylkevych
team in medias GmbH - 02 41- 4 09 09 09
www.inmedias.de - www.allfinanz-net.de
More information about the opencms-dev
mailing list