[opencms-dev] Bug or feature?

Stephen Scholtz stephen at bluespark.com
Fri Jun 27 17:36:00 CEST 2003


Frank Wunderlich wrote:
> The problem: After the inclusion of page 2, the body-content of page 1
> is not 
> accessible anymore. Instead of showing the bodycontent of page 1, the 
> bodycontent of the included page is shown again.
> 
> While the following works fine:
> 
> <cms:include element="body" />  <%-- The correct bodycontent of page 1
> is displayed --%>
> <% aCmsJspActionElement.include(uriOfPage2, "body"); %>  <%-- The
> content of page 2 is inserted correctly --%>
> 
> 
> This does not lead to the expected result:
> 
> <% aCmsJspActionElement.include(uriOfPage2, "body"); %>  <%-- The
> content of page 2 is inserted correctly --%>
> <cms:include element="body" />  <%-- The content of the 
> included page 2
> (and not page 1!) is shown again!! --%>



Just a hunch, but it could it be that your first line,
"aCmsJspActionElement.include(uriOfPage2, "body");", defines the value
of element "body" and then when the cms tag displays "body" it get
page2's value, not page1's (the parent page), because "body" has been
set by the inclusion of page2.

This would explain why the first one works (print out page1's value for
"body", then include page2 which changes the value of "body" and
displays it) and the second one doesn't (page2 is included, displays its
value for "body" as well as changing that value for the page, then the
simple <cms:include> tag merely displays what value is set for "body",
which in this case is "body" from page2).

That was really confusing, hope it makes sense.  I don't know if that's
the reason, but it's my hypothesis, in which case this is a "feature".
;)

Cheers,
  Stephen Scholtz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20030627/11458d2b/attachment.htm>


More information about the opencms-dev mailing list