[opencms-dev] question about nested content
Borja Fernandez Pillado
borja.fpillado at gmail.com
Tue Jun 1 10:28:36 CEST 2010
Hi Tim,
I'm gonna try to explain you what you have to do for working all these
things out and why it doesn't work. Well, in the first xml content you have
a VFS field, where you edit a path, everything ok till here. Although the
path is pointing to another xml content, it doesn't matter, it is just a
path, so there's no more information in this field.
So If you write in your jsp
<cms:contentload><cms:contentloop><cms:contentshow> you are getting the
directions, the paths which you edited previously.
The way that I solve this is keeping the path in the pageContext and then I
open another <cms:contentload>. This is an example:
<cms:contentload collector="XXX" param="XXX" >
<cms:contentcheck ifexists="FieldVFS">
<cms:contentloop element="FieldVFS">
<c:set var="myPath"> <cms:contentshow/> </c:set>
<cms:contentload collector="singleFile"
param="%(pageContext.myPath)" >
// Your code here
</cms:contentload>
</cms:contentloop>
</cms:contentcheck>
</cms:contentload>
As you can see, we get the path from the first xml and then we get the
information of the nested xml content. I hope to help you.
Regards
2010/5/31 Tim Daschner <timd at thedoleco.com>
> Hello,
>
> I have a xml content definition which has a field that can contain 0 or
> more vfs files. these vfs file in turn is another xml content file. This
> works fine as far as content editing is concerned. SO,. I can open the main
> piece of content and can easily edit the file path on the nested xml
> content. The nested xml content itself has 0 or more Images. All of this
> works in the workplace. Now, when I start to write the JSP to display this,
> can I still use the standard
> <cms:contentload><cms:contentloop><cms:contentshow> paradigm? It appears
> not! So, how does one code the display of these nested images in JSP? Is it
> absolutely necessary here to write this in java scriptlet code? Will this
> comcept work in scriptlet code?
>
> The real life case here is that our client's articles are made of multiple
> other text/image content which are then picked at production time by
> editors. On the front end, a neat little javascript shows one of the
> multiple text/image content based on user interaction.
>
> Please help to make this work.
>
> BEst,
> Tim
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100601/a01dcea5/attachment.htm>
More information about the opencms-dev
mailing list