2015-10-05 62 views
0

我不确定在每个标签文件的开始放置什么。我试图将“基本”和“高级”分成自己的选项卡,例如tab_basic和tab_advance。我不确定我是否想在每个选项卡文件的开头使用(jcr:root,content,layout和items),如果有,我该如何正确地执行此操作?如何分割触摸UI对话框文件?

<?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" 
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"> 
     <basic 
      jcr:primaryType="nt:unstructured" 
      jcr:title="Basic" 
      sling:resourceType="granite/ui/components/foundation/container"> 
      <layout 
       jcr:primaryType="nt:unstructured" 
       sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/> 
      <items jcr:primaryType="nt:unstructured"> 
       <columns 
        jcr:primaryType="nt:unstructured" 
        sling:resourceType="granite/ui/components/foundation/container"> 
        <items jcr:primaryType="nt:unstructured"> 
         <basic 
          jcr:primaryType="nt:unstructured" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset"> 
          <items jcr:primaryType="nt:unstructured"> 
           <title 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldLabel="Title" 
            name="./jcr:title"/> 
           <canonicalUrl 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldDescription="Enter the proper canonical Url.e.g.http://example.com/page.html" 
            fieldLabel="Canonical Url" 
            name="./canonicalUrl"/> 
           <tags 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/autocomplete" 
            fieldLabel="Tags/Keywords" 
            multiple="{Boolean}true" 
            name="./cq:tags"> 
            <datasource 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="cq/gui/components/common/datasources/tags"/> 
            <values 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="granite/ui/components/foundation/form/autocomplete/tags"/> 
            <options 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="granite/ui/components/foundation/form/autocomplete/list"/> 
           </tags> 
           <hideinnav 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./hideInNav" 
            text="Hide in Navigation" 
            value="true"/> 
           <hideinnav-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <newwindow 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            fieldDescription="Decides whether the link in the secondary navigation opens in a new window." 
            name="./newwindow" 
            text="New Window from Secondary Navigation" 
            value="true"/> 
           <newwindow-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <hideinFooter 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./hideinFooter" 
            text="Hide in Footer" 
            value="true"/> 
           <hideinfooter-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <disableNavLink 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./disableNavLink" 
            text="Disable link in Sitemap" 
            value="true"/> 
           <disablenavlink-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <headerfooter 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./headerfooter" 
            text="Header/Footer OFF" 
            value="true"/> 
           <headerfooter-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <livechat 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./livechat" 
            text="Live Chat OFF" 
            value="true"/> 
           <livechat-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <headerView 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/select" 
            fieldDescription="Select header and footer view to be displayed. By default, View1 will be displayed." 
            fieldLabel="Header - Footer View" 
            name="./headerView" 
            value="view1"> 
            <items jcr:primaryType="nt:unstructured"> 
             <view1 
              jcr:primaryType="nt:unstructured" 
              text="View1" 
              value="view1"/> 
             <view2 
              jcr:primaryType="nt:unstructured" 
              text="View2" 
              value="view2"/> 
            </items> 
           </headerView> 
           <disableMegaMenu 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            fieldDescription="Disable the showing of the mega-menu when hovering over navigation bar menu items" 
            name="./disableMegaMenu" 
            text="Disable MegaMenu" 
            value="true"/> 
           <disablemegamenu-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <disableSearch 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            fieldDescription="Disable the search box that appears in the nav drawer menu in mobile and tablet view" 
            name="./disableNavSearch" 
            text="Disable Nav Drawer Search"/> 
           <disablesearch-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
           <pagetheme 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/autocomplete" 
            fieldLabel="Theme Tag" 
            multiple="{Boolean}true" 
            name="./themetag"> 
            <datasource 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="cq/gui/components/common/datasources/tags"/> 
            <values 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="granite/ui/components/foundation/form/autocomplete/tags"/> 
            <options 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="granite/ui/components/foundation/form/autocomplete/list"/> 
           </pagetheme> 
          </items> 
         </basic> 
         <more_titles 
          jcr:primaryType="nt:unstructured" 
          jcr:title="More Titles and Description" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset" 
          title="More Titles and Description"> 
          <items jcr:primaryType="nt:unstructured"> 
           <pagetitle 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldLabel="Page Title" 
            name="./pageTitle"/> 
           <navtitle 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldLabel="Navigation Title" 
            name="./navTitle"/> 
           <subtitle 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldLabel="Subtitle" 
            name="./subtitle"/> 
           <description 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textarea" 
            fieldLabel="Description" 
            name="./jcr:description"/> 
          </items> 
         </more_titles> 
         <onofftime 
          jcr:primaryType="nt:unstructured" 
          jcr:title="On/Off Time" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset" 
          title="On/Off Time"> 
          <items jcr:primaryType="nt:unstructured"> 
           <ontime 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/datepicker" 
            fieldLabel="On Time" 
            name="./onTime" 
            type="datetime"/> 
           <offtime 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/datepicker" 
            fieldLabel="Off Time" 
            name="./offTime" 
            type="datetime"/> 
           <onTimeHint 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="Date"/> 
           <offTimeHint 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="Date"/> 
          </items> 
         </onofftime> 
         <vanity 
          jcr:primaryType="nt:unstructured" 
          jcr:title="Vanity URL" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset" 
          title="Vanity URL"> 
          <items jcr:primaryType="nt:unstructured"> 
           <vanityPath 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/multifield" 
            fieldLabel="Vanity URL"> 
            <field 
             jcr:primaryType="nt:unstructured" 
             sling:resourceType="granite/ui/components/foundation/form/textfield" 
             name="./sling:vanityPath" 
             required="{Boolean}false"/> 
           </vanityPath> 
           <vanityPathRedirect 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./sling:redirect" 
            text="Redirect Vanity URL"/> 
           <vanitypathredirect-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./sling:[email protected]" 
            value="{Boolean}true"/> 
          </items> 
         </vanity> 
        </items> 
       </columns> 
      </items> 
     </basic> 
     <advanced 
      jcr:primaryType="nt:unstructured" 
      jcr:title="Advanced" 
      sling:resourceType="granite/ui/components/foundation/container"> 
      <layout 
       jcr:primaryType="nt:unstructured" 
       sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/> 
      <items jcr:primaryType="nt:unstructured"> 
       <columns 
        jcr:primaryType="nt:unstructured" 
        sling:resourceType="granite/ui/components/foundation/container"> 
        <items jcr:primaryType="nt:unstructured"> 
         <custom 
          jcr:primaryType="nt:unstructured" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset"> 
          <items jcr:primaryType="nt:unstructured"> 
           <scrollMore 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            fieldDescription="Enable the 'scroll more' button on this page" 
            name="./scrollMore" 
            text="Enable Scroll More Button" 
            value="true"/> 
           <scrollmore-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
          </items> 
         </custom> 
         <partner 
          jcr:primaryType="nt:unstructured" 
          jcr:title="Partner Sites" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset" 
          title="Partner Sites"> 
          <items jcr:primaryType="nt:unstructured"> 
           <isPartner 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            fieldDescription="Identify the page and its children pages as partner sites" 
            name="./isPartner" 
            text="Is Partner Site"/> 
           <ispartner-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./[email protected]" 
            value="{Boolean}true"/> 
          </items> 
         </partner> 
         <advanced 
          jcr:primaryType="nt:unstructured" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset"> 
          <items jcr:primaryType="nt:unstructured"> 
           <language 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/select" 
            fieldLabel="Language" 
            name="./jcr:language"> 
            <items jcr:primaryType="nt:unstructured"/> 
           </language> 
           <redirect 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/pathbrowser" 
            fieldLabel="Redirect" 
            name="./redirectTarget"/> 
           <designpath 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/pathbrowser" 
            fieldLabel="Design" 
            name="./cq:designPath" 
            rootPath="/etc/designs"/> 
           <styling 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/pathbrowser" 
            fieldDescription="This includes the Look &amp; Feel of the page" 
            fieldLabel="Styling" 
            name="./cssPath" 
            rootPath="/etc/designs"/> 
           <alias 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldLabel="Alias" 
            name="./sling:alias"/> 
          </items> 
         </advanced> 
         <site-structure/> 
         <cug 
          jcr:primaryType="nt:unstructured" 
          jcr:title="Closed User Group" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset" 
          title="Closed User Group"> 
          <items jcr:primaryType="nt:unstructured"> 
           <enabled 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/checkbox" 
            name="./cq:cugEnabled" 
            text="Enabled" 
            value="true"/> 
           <enabled-delete 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/hidden" 
            name="./cq:[email protected]" 
            value="{Boolean}true"/> 
           <loginPage 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/pathbrowser" 
            fieldLabel="Login Page" 
            name="./cq:cugLoginPage"/> 
           <principals 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/multifield" 
            fieldLabel="Admitted Groups"> 
            <field/> 
           </principals> 
           <realm 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldDescription="Leave empty to use the page title." 
            fieldLabel="Realm" 
            name="./cq:cugRealm"/> 
          </items> 
         </cug> 
         <export 
          jcr:primaryType="nt:unstructured" 
          jcr:title="Export" 
          sling:resourceType="granite/ui/components/foundation/form/fieldset" 
          title="Export"> 
          <items jcr:primaryType="nt:unstructured"> 
           <template 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/pathbrowser" 
            fieldLabel="Export Configuration" 
            name="./cq:exportTemplate" 
            rootPath="/etc/contentsync/templates"/> 
          </items> 
         </export> 
        </items> 
       </columns> 
      </items> 
     </advanced> 

回答

3

您可能需要使用两个属性:pathsling:resourceSuperType新台币里面:非结构化节点(标签项目)。这里是我的对话框

<?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="Sample Component" 
    sling:resourceType="cq/gui/components/authoring/dialog" 
    helpPath="en/cq/current/wcm/default_components.html"> 
    <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" 
      sling:hideChildren="[column]"> 
      <fname 
       jcr:primaryType="nt:unstructured" 
       jcr:title="First Name" 
       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"> 
        <column 
         jcr:primaryType="nt:unstructured" 
         sling:resourceType="granite/ui/components/foundation/container"> 
         <items jcr:primaryType="nt:unstructured"> 
          <firstname 
           jcr:primaryType="nt:unstructured" 
           sling:resourceType="granite/ui/components/foundation/form/textfield" 
           fieldDescription="Mandatory" 
           fieldLabel="First Name" 
           name="./fname"/> 
         </items> 
        </column> 
       </items> 
      </fname> 
      <mname 
        jcr:primaryType="nt:unstructured" 
        jcr:title="Middle Name" 
        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"> 
        <column 
          jcr:primaryType="nt:unstructured" 
          sling:resourceType="granite/ui/components/foundation/container"> 
         <items jcr:primaryType="nt:unstructured"> 
          <middlename 
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/foundation/form/textfield" 
            fieldDescription="Mandatory" 
            fieldLabel="Middle Name" 
            name="./mname"/> 
         </items> 
        </column> 
       </items> 
      </mname> 
      <lname 
       jcr:primaryType="nt:unstructured" 
       sling:resourceType="granite/ui/components/foundation/include" 
       path="/apps/project/components/lname"/> 
     </items> 
    </content> 
</jcr:root> 

这里/apps/project/components/lname content.xml中的节点称为作为标签。下面是该节点的content.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/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="Last Name" 
    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"> 
     <column 
      jcr:primaryType="nt:unstructured" 
      sling:resourceType="granite/ui/components/foundation/container"> 
      <items jcr:primaryType="nt:unstructured"> 
       <lname 
        jcr:primaryType="nt:unstructured" 
        sling:resourceType="granite/ui/components/foundation/form/textfield" 
        fieldDescription="Mandatory" 
        fieldLabel="Last Name" 
        name="./lname"/> 
      </items> 
     </column> 
    </items> 
</jcr:root> 

这里LNAME是例如,您可以为tab_basic和tab_advance做到这一点。