2016-05-31 78 views
2

我正在嘗試添加新選項卡並刪除頁面屬性工作中的選項卡/項目。AEM 6.1添加選項卡以觸摸用戶界面頁面屬性

到目前爲止,我已經通過這個類似的問題閱讀:http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__m3tp-there_is_anarticle.html

導致我對這些的Adobe鏈接和GitHub的例子:

我h ave複製了頁面的頁面屬性的.context.xml的github示例,並且它沒有隱藏任何內容。

我也取代CQ:showOnCreate =「{}布爾假」CQ:hideOnEdit =「{}布爾真」像以前的土坯幫助論壇建議,這也不管用。

如何隱藏和顯示項目?

而且,與傳統UI過去我們能夠做這樣的事情,包括更多的標籤:

<sample 
jcr:primaryType="cq:Widget" 
path="/apps/company/components/Pages/basePage/sample_tab.infinity.json" 
xtype="cqinclude"/> 

我如何在觸摸UI添加新的選項卡類似於infinity.json的東西嗎?花崗岩包括?

回答

1

與使用granite/ui/components/foundation/includepath屬性一樣,您可以在Classic中重複使用選項卡。

在下面的例子中,我們有一個標題組件,其中包含一個普通的文本小部件,並引入一個可重用的組件設置標籤。我已將共享標籤放在/apps/mysite/dialogs/granite/tabs下,但這不是必需的,您可以簡單地更新path屬性。

這是在/apps/mysite/components/heading/_cq_dialog.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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 
    jcr:primaryType="nt:unstructured" 
    jcr:title="Heading" 
    sling:resourceType="cq/gui/components/authoring/dialog" 
    helpPath="en/cq/current/wcm/default_components.html#Carousel"> 
    <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"> 
      <generalSettings 
       jcr:primaryType="nt:unstructured" 
       jcr:title="General Settings" 
       sling:resourceType="granite/ui/components/foundation/section"> 
       <layout 
        jcr:primaryType="nt:unstructured" 
        sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/> 
       <items jcr:primaryType="nt:unstructured"> 
        <column 
         jcr:primaryType="nt:unstructured" 
         sling:resourceType="granite/ui/components/foundation/container"> 
         <items jcr:primaryType="nt:unstructured"> 
          <headingText 
           jcr:primaryType="nt:unstructured" 
           sling:resourceType="granite/ui/components/foundation/form/textfield" 
           fieldLabel="Text" 
           name="./text"/> 
         </items> 
        </column> 
       </items> 
      </generalSettings> 
      <componentSettings 
       jcr:title="Component Settings" 
       jcr:primaryType="nt:unstructured" 
       sling:resourceType="granite/ui/components/foundation/include" 
       path="mysite/dialogs/granite/tabs/componentSettings"/> 
     </items> 
    </content> 
</jcr:root> 

可重複使用的組件設置選項卡住在/apps/mysite/dialogs/granite/tabs/componentSettings.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="Settings" 
    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"> 
       <componentId 
        jcr:primaryType="nt:unstructured" 
        sling:resourceType="granite/ui/components/foundation/form/textfield" 
        fieldLabel="Component Id" 
        name="./componentId"/> 
      </items> 
     </column> 
    </items> 
</jcr:root> 
相關問題