<font size=2 face="sans-serif">Hi All,</font>
<br>
<br><font size=2 face="sans-serif">i have created a new site in opencms
9, in which i have created a dynamic function which will list the resources
name and their link. I have created an article which is also displaying
but the link generated is not correct. It it direct link to article, it
should be link via detail page which in configured in .config file.</font>
<br>
<br><font size=2 face="sans-serif">Code: </font>
<br>
<br><font size=2 face="sans-serif"><%@page buffer = "none"
session = "false" trimDirectiveWhitespaces="true" import
= "org.opencms.jsp.CmsJspActionElement"%></font>
<br><font size=2 face="sans-serif"><%@page import = "org.opencms.file.CmsObject,org.opencms.relations.CmsCategoryService,
org.opencms.file.CmsResource, java.util.List, java.util.Iterator"%></font>
<br><font size=2 face="sans-serif"><%@page import = "org.opencms.file.CmsPropertyDefinition"
%></font>
<br><font size=2 face="sans-serif"><%@taglib prefix = "cms"
uri="</font><a href=http://www.opencms.org/taglib/cms><font size=2 face="sans-serif">http://www.opencms.org/taglib/cms</font></a><font size=2 face="sans-serif">"
%></font>
<br><font size=2 face="sans-serif"><%@taglib prefix = "c"
uri="</font><a href=http://java.sun.com/jsp/jstl/core><font size=2 face="sans-serif">http://java.sun.com/jsp/jstl/core</font></a><font size=2 face="sans-serif">"
%></font>
<br><font size=2 face="sans-serif"><%</font>
<br><font size=2 face="sans-serif">CmsJspActionElement cms = new CmsJspActionElement
(pageContext, request, response);</font>
<br><font size=2 face="sans-serif">CmsObject cmso = cms.getCmsObject();</font>
<br>
<br><font size=2 face="sans-serif">// Get the category service instance</font>
<br><font size=2 face="sans-serif">CmsCategoryService cs = CmsCategoryService.getInstance();</font>
<br>
<br><font size=2 face="sans-serif">// Get resources assigned a specific
category. (You could also provide a CmsResourceFilter here.)</font>
<br><font size=2 face="sans-serif">List<CmsResource> categoryResources
= cs.readCategoryResources(cmso, "somelink/", true,"/");</font>
<br><font size=2 face="sans-serif">%></font>
<br><font size=2 face="sans-serif"><div></font>
<br><font size=2 face="sans-serif"> <div
class="headline"><h4>Some Links</h4></div></font>
<br><font size=2 face="sans-serif"> <div
class="left-nav"></font>
<br><font size=2 face="sans-serif"><%</font>
<br><font size=2 face="sans-serif">// First check if there is something
to work with</font>
<br><font size=2 face="sans-serif">if (!categoryResources.isEmpty()) {</font>
<br><font size=2 face="sans-serif">%></font>
<br><font size=2 face="sans-serif"> <ul></font>
<br><font size=2 face="sans-serif"><%</font>
<br><font size=2 face="sans-serif">Iterator<CmsResource> i = categoryResources.iterator();</font>
<br><font size=2 face="sans-serif">while (i.hasNext()) {</font>
<br><font size=2 face="sans-serif">
CmsResource r = i.next();</font>
<br>
<br><font size=2 face="sans-serif">
String uri = cmso.getSitePath(r);</font>
<br><font size=2 face="sans-serif">%></font>
<br><font size=2 face="sans-serif">
<div></font>
<br><font size=2 face="sans-serif">
<li class="margin-bottom-10 left-nav-list"><a
href="<%= cms.link(uri) %>"><%= cms.property(CmsPropertyDefinition.PROPERTY_TITLE,
uri, uri) %></a></li></font>
<br><font size=2 face="sans-serif">
</div></font>
<br><font size=2 face="sans-serif"><%</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif">%></font>
<br><font size=2 face="sans-serif"></ul></font>
<br><font size=2 face="sans-serif"><%</font>
<br><font size=2 face="sans-serif">} else {</font>
<br><font size=2 face="sans-serif">%></font>
<br><font size=2 face="sans-serif">
<p style="color: #fff;">No resources in this
category</p></font>
<br><font size=2 face="sans-serif"><%</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif">%></font>
<br><font size=2 face="sans-serif"></div></font>
<br><font size=2 face="sans-serif"></div></font>
<br>
<br><font size=2 face="sans-serif">I have configure detail page also for
article in which i have specify ddarticle as type and a template for articles.
I am storing articles in .content -> article folder.</font>
<br>
<br><font size=2 face="sans-serif">Please friends help me out.</font>
<br>
<br><font size=2 face="sans-serif">With Regards</font>
<br><font size=2 face="sans-serif">Manoj Kumar Sharma</font>