一,目录结构
二,HTML
<sly data-sly-test.empty="${!properties.title}"/> <div data-sly-test="${empty && wcmmode.edit}" class="cq-placeholder" data-emptytext="Detail Info Component"></div> <sly data-sly-test="${!empty}"> <!--context--> </sly>
三,.content.xml
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:description="Detail Info Component" jcr:primaryType="cq:Component" jcr:title="Detail Info" sling:resourceSuperType="wcm/foundation/components/parsys" allowedParents="[*/parsys]" componentGroup="Test"/>
四,Touch UI dialog
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" jcr:title="Detail Info Component" sling:resourceType="cq/gui/components/authoring/dialog"> <content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/tabs" type="nav"/> <items jcr:primaryType="nt:unstructured"> <general jcr:primaryType="nt:unstructured" jcr:title="General" sling:resourceType="granite/ui/components/foundation/section"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns" margin="{Boolean}false"/> <items jcr:primaryType="nt:unstructured"> <columns jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container"> <items jcr:primaryType="nt:unstructured"> </items> </columns> </items> </general> <share jcr:primaryType="nt:unstructured" jcr:title="share" sling:resourceType="granite/ui/components/foundation/section"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns" margin="{Boolean}false"/> <items jcr:primaryType="nt:unstructured"> <columns jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container"> <items jcr:primaryType="nt:unstructured"> </items> </columns> </items> </share> </items> </content> </jcr:root>
<title jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldLabel="Title" fieldDescription="title field" name="./title" required="{Boolean}true"/>
<linkURL jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/pathbrowser" fieldLabel="Link URL" fieldDescription="Link URL" name="./linkURL" required="{Boolean}true" rootPath="/content"/>
<shareType jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/select" fieldLabel="Share Type" name="./shareType"> <items jcr:primaryType="nt:unstructured"> <option1 jcr:primaryType="nt:unstructured" text="twitter" selected="{Boolean}true" value="twitter"/> <option2 jcr:primaryType="nt:unstructured" text="facebook" value="facebook"/> </items> </shareType>
<htmlCode jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/textarea" fieldLabel="HTML Code" name="./htmlCode"/>
<image jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/fileupload" autoStart="{Boolean}false" allowUpload="{Boolean}false" disableZoom="{Boolean}true" allowBlank="{Boolean}false" fieldLabel="Image" fileNameParameter="./fileName" fileReferenceParameter="./fileReference" mimeTypes="[image]" name="./image" title="Upload Image" uploadUrl="${suffix.path}" useHTML5="{Boolean}true"> </image>
<list sling:resourceType="granite/ui/components/foundation/form/multifield" fieldDescription="Click + to add a new field" fieldLabel="List" jcr:primaryType="nt:unstructured"> <field jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/fieldset" acs-commons-nested="JSON_STORE" name="./breadcrumbList"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns" method="absolute"/> <items jcr:primaryType="nt:unstructured"> <column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container"> <items jcr:primaryType="nt:unstructured"> <title jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldLabel="Title" name="./title"/> </items> </column> </items> </field> </list>