[opencms-dev] Site Map
Romano Tiziano
tiziano.romano at netikos.com
Thu Oct 30 10:57:02 CET 2003
Martijn,
try with this:
<%@ taglib prefix="cms" uri=" http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="c" uri=" http://java.sun.com/jstl/core" %>
<%@ page import="com.opencms.flex.jsp.*,com.opencms.file.*,java.util.*" %>
<%!
public void buildSiteMap(com.opencms.flex.jsp.CmsJspActionElement cms,
String uri, java.io.Writer out) throws Exception {
String desc;
ArrayList navList = cms.getNavigation().getNavigationForFolder(uri);
if (navList.size() > 0)
{
Iterator navItem = navList.iterator();
CmsJspNavElement nav;
String target;
while (navItem.hasNext())
{
nav = (CmsJspNavElement) navItem.next();
if (nav != null)
{
target = nav.getResourceName();
target = cms.link(target);
if (nav.isFolderLink())
{
if (nav.getNavTreeLevel() == 2)
{
out.write("<tr><td align=left valign=top> <font class = \"bandtit2\">" + nav.getNavText() + "</font></td></tr>\n");
out.write("<tr><td height=\"1\" valign=\"top\" bgcolor=\"#CCCCCC\"><img src=\"" + cms.link("../resources/spacer.gif") + "\" width=\"1\" height=\"1\"></td></tr>\n");
}
else
{
out.write("<tr><td align=left valign=top> <strong>›</strong> <a href=\"" + target + "\" class=\"bandsottitle\" >" + nav.getNavText() + "</a></td></tr>\n");
}
}
else
{
out.write("<tr><td align=left valign=top> - <a href=\"" + target + "\" class=\"navig\" >" + nav.getNavText() + "</a></td></tr>\n");
}
desc = nav.getDescription();
if (desc != null) out.write(" " + desc);
if (nav.isFolderLink())
{
buildSiteMap(cms, nav.getResourceName(), out);
}
}
}
}
}
%>
<%
// create a JSP action element
com.opencms.flex.jsp.CmsJspActionElement cms = new com.opencms.flex.jsp.CmsJspActionElement(pageContext, request, response);
%>
<% buildSiteMap(cms, uri, out); %>
</cms:template>
I wish it could help you!
Kind regards,
Tiziano
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Tiziano Romano
NETikos S.p.A.
Via Matteucci, 34 B
56124 PISA - ITALY
Tel.: + 39 050 968 553
Fax: + 39 050 968 525
< mailto:tiziano.romano at netikos.com>
www.netikos.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-----Original Message-----
From: opencms-dev-admin at opencms.org [mailto:opencms-dev-admin at opencms.org]On Behalf Of Martijn Schiferli
Sent: Thursday, October 30, 2003 10:15
To: opencms-dev at opencms.org
Subject: [opencms-dev] Site Map
Hi All,
I know for sure that some one has done it before a dynamic sitemap. So to avoid reinventing the wheel could some one please give me a sample to start from.
Regards,
Martijn Schiferli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20031030/566c3e21/attachment.htm>
More information about the opencms-dev
mailing list