[opencms-dev] Use of cms:includ>

William T. Mann wtmann at linuxthinktank.org
Wed May 23 10:32:24 CEST 2007


Florian Hopf ha scritto:
> Hi,
> 
> William T. Mann wrote:
>> However, if I try to do it dynamically it won't work:
>>
>> <cms:contentcheck ifexists element="Sector">
>>     <p>Sector: <cms:include file="<cms:contentshow element="Sector"/>"
>> element="Description" /></p>
>> </cms:contentcheck>
>>
>> This gives an error. Is it possible? What am I missing?
>>
> Did you try
> 
> <cms:include>
>     <cms:contentshow element="Sector"/>
> </cms:include>

I tried that but then I get an unknown error that doesn't return a 
message. However, I discovered that if I set up a request attribute and 
then use the attribute in the include statement it works. My problem 
then becomes how do I set up an attribute using the value from a content 
field? I'd like to do something like this:

<% request.setAttribute("page", <cms:showcontent element="Sector"/>); %>

which obviously doesn't work. Is something like this possible though? 
Thanks for the help.

-- 
William



More information about the opencms-dev mailing list