AEM 6.1添加选项卡以触摸UI页面属性

时间:2016-05-31 16:58:53

标签: adobe aem

我正在尝试添加新标签并删除页面属性中的标签/项目。

到目前为止,我已经阅读了这个类似的问题:http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__m3tp-there_is_anarticle.html

这引导我了解这些Adobe链接和github示例:

我已经为页面的页面属性复制了 .context.xml 的github示例,但它没有隐藏任何内容。

我还将 cq:showOnCreate =“{Boolean} false”替换为 cq:hideOnEdit =“{Boolean} true”,就像之前建议的adobe帮助论坛一样也不起作用。

如何隐藏和显示项目?

此外,在过去的经典用户界面中,我们可以做这样的事情来包含更多标签:

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

如何在Touch UI中添加类似于infinity.json的新标签?花岗岩包括?

1 个答案:

答案 0 :(得分:2)

您可以使用granite/ui/components/foundation/include属性path,在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>
相关问题