[opencms-dev] contenload & include

Ruben Malchow ruben at disk0.de
Mon Aug 3 02:11:32 CEST 2009



hello list,

i have a little question about taglib usage ... first, here's what i
want to do:

	<cms:contentload
		collector="allInSubTree"
		param="/articles/|999">

		<c:set
			var="file">
			<cms:contentshow
			element="%(opencms.filename)"/>
		</c:set>
			
		including: <c:out value="${file}"/>
		<!---

		here, i want to actually include that file, passing
		some parameters instructing it to render itself
		slightly different than normal
		
		-->

	</cms:contentload>



so, the template assigned to the "articles" knows how to render itself
as a complete page, but also, it takes parameters controlling that
behavious. mainly, i have two parameters, the first one controlling
wether or not to render the entire article or just the headline and
abstract, the second one controlling wether or not to include the full
html header and footer and whatnot.

what i want to do is include the html snippet produced by this template
in a list using only taglib things ... so far, i have been unable to,
biggest problem being a NPE being raised whenever i try to "include" an
XmlContent - even if it is a fixed path:

	<cms:include page="path/to/someXmlContent.html" />

gives me a NPE, while:

	<cms:include page="path/to/somePlainTextFile.txt" />

works perfectly ok .... i guess there is something about the include tag
i didn't quite understand yet? if anyone knows what it is .... well,
help and hints appreciated :)

i have done it using actual java code before, but the point here would
be to do as much as possible in taglibs ... and i think it must be
doable ...

ruben






More information about the opencms-dev mailing list