[opencms-dev] contenload & include

Christian Steinert christian_steinert at web.de
Mon Aug 3 22:28:04 CEST 2009


Ruben Malchow wrote:
> 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 ...
>
>   
Could this be a problem with an incorrect template and/or 
template-elements property for the xml file that you try to include? 
Make sure that both of these properties are present and correctly set.

Also, please try to see, if cmsJSPActionElement.include will REALLY work 
for the exact same file that you have problems with when using the 
cms:include tag. Normally, either both ways should work or both ways 
should fail.

Christian



More information about the opencms-dev mailing list