[opencms-dev] Re: Why I failed in editing structured content?Cananyone give me a hand

Huang Zhibin zbhuang2002 at hotmail.com
Mon May 22 17:33:55 CEST 2006


Hi, Toni, it helps, thanks again.
Huang


>From: "Toni Pérez" <tp.ocms at gmail.com>
>Reply-To: The OpenCms mailing list <opencms-dev at opencms.org>
>To: "The OpenCms mailing list" <opencms-dev at opencms.org>
>Subject: Re: [opencms-dev] Re: Why I failed in editing structured 
content?Cananyone give me a hand
>Date: Sun, 21 May 2006 18:53:50 +0200
>
>Hi, Huang.
>
>
>>[...]   Now I have another problems. I want to extend this 
>>tutorial, that is I
>>want to display multiple images. To that, I change the 
>>wdog_article.xsd
>>from
>>         <xsd:element name="Image" type="OpenCmsVfsFile" 
>>minOccurs="0" />
>>to
>>         <xsd:element name="Image" type="OpenCmsVfsFile" 
>>minOccurs="0"
>>maxOccurs="5"/>
>>and in file of article.jsp, I change
>>         <p><img src="<cms:link><cms:contentshow element="Image" 
>>/></cms:link>"
>> ></p>
>>to
>>         <cms:contentloop element="Image">
>>                 <p><img src="<cms:link><cms:contentshow 
>>element="Image" /></cms:link>"
>> ></p>
>>         </cms:contentloop>
>>or
>>         <cms:contentcheck ifexists="Image">
>>         <cms:contentloop element="Image">
>>                 <p><img src="<cms:link><cms:contentshow 
>>element="Image" /></cms:link>"
>> ></p>
>>         </cms:contentloop>
>>         </cms:contentcheck>
>>and in test dir, I add two images in the html file, but images do 
>>not
>>appear.
>>
>>I also look through the news demo, found that in page of
>>list_news_center.jsp, also using contentloop method, but they 
>>working not
>>mine.
>>
>>I do not know what I neglect, so can you give me suggestions?
>
>
>I think you have to write "<cms:contentshow />" instead of
>"<cms:contentshow element="Image" />".
>
>The element "Image" in the "news" structured content type is of type
>"OpenCmsImage" which is a nested structured content type that has an
>element also named "Image".
>
>In your XSD you are defining an element "Image" of type
>"OpenCmsVfsFile" which is a simple type so "<cms:contentshow />"
>should be sufficient to iterate over the images of your content.
>
>I hope that helps.
>
>_______________________________________________
>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





More information about the opencms-dev mailing list