<p>I needed to get the CmsResource object inside of the <cms:contentload> tag, but the tag doesn't make the current resource available as a scripting variable. So, I had to customize the org.opencms.jsp.CmsJspTagContentLoad class to make that object available:</p>
<pre>
protected void doLoadNextFile() throws CmsException {
// get the next resource from the collector
CmsResource resource = getNextResource();
if (resource == null) {
m_resourceName = null;
m_content = null;
return;
}
<b>pageContext.setAttribute( "resource", resource );</b>
...
}
</pre>
<p>This customization allows me to access the current CmsResource like ${resource.name} (same as CmsResource.getName()). However, the variable name "resource" is hardcoded. Most tags allow the user to specify the name of the scripting variable using an "id" attribute on the tag. See http://java.sun.com/j2ee/1.3/docs/tutorial/doc/JSPTags4.html#wp66315 for reference.</p>
<p>Anyway, that's my suggested improvement.</p>
<p>Thanks,<br />
Eric</p>
<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/Recommendation-for-%3Ccms%3Acontentload%3E-tag-tf3659249.html#a10224509">Recommendation for <cms:contentload> tag</a><br>
Sent from the <a href="http://www.nabble.com/OpenCMS---Dev-f654.html">OpenCMS - Dev mailing list archive</a> at Nabble.com.<br>