[opencms-dev] Fwd: Issue with default values in the content type
Ashish Shekhar
ashish.shekharcsc at gmail.com
Wed Jul 15 14:48:53 CEST 2015
Hi.
Does anyone have idea how to set the default value for nested content type?
I tried all the approaches suggested but doesn't make any difference.
-Ashish
---------- Forwarded message ----------
From: Ashish Shekhar <ashish.shekharcsc at gmail.com>
Date: Mon, Jul 13, 2015 at 2:57 PM
Subject: Issue with default values in the content type
To: The OpenCms mailing list <opencms-dev at opencms.org>
Hi,
I have created content type for which I have configure xsd as per my need.
The default value which is coming fine for simple xml content type but when
I used nested content type the default value is not coming.
I want the default value should come to every nested items when ever I add
new instance + but its not coming to a single instance.
I am attaching my xsd. Does anyone have idea what is missing here?
Thanks
Ashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20150715/79c882aa/attachment.htm>
-------------- next part --------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
<xsd:include schemaLocation="opencms://system/modules/my.template/schemas/nested/address.xsd"/>
<xsd:element name="OceanSchms" type="OpenCmsOceanSchms"/>
<xsd:complexType name="OpenCmsOceanSchms">
<xsd:sequence>
<xsd:element name="OceanSchm" type="OpenCmsOceanSchm" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OpenCmsOceanSchm">
<xsd:sequence>
<xsd:element name="MainContent" type="OpenCmsAddress" minOccurs="1" maxOccurs="10" />
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
</xsd:complexType>
</xsd:schema>
-------------- next part --------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
<xsd:element name="Addresss" type="OpenCmsAddresss"/>
<xsd:complexType name="OpenCmsAddresss">
<xsd:sequence>
<xsd:element name="Address" type="OpenCmsAddress" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OpenCmsAddress">
<xsd:sequence>
<xsd:element name="Title" type="OpenCmsString" />
<xsd:element name="Text" type="OpenCmsHtml" />
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
</xsd:complexType>
<xsd:annotation>
<xsd:appinfo>
<mappings>
<mapping element="Title" mapto="property:Title" />
<mapping element="Title" mapto="urlName" />
</mappings>
<defaults>
<default element="Title" value="Add a new title here" />
<default element="Text" value="Add your text" />
</defaults>
<layouts>
<layout element="Text" widget="HtmlWidget" configuration="height:400px,link,anchor,source,downloadgallery,formatselect" />
</layouts>
<validationrules/>
<relations/>
<searchsettings containerPageOnly="true"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
More information about the opencms-dev
mailing list