微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在页面属性对话框Touch UI中隐藏继承的属性

如何解决在页面属性对话框Touch UI中隐藏继承的属性

我想隐藏从/ libs / wcm / foundation / components / basicpage / v1 / basicpage继承的某个选项卡中的属性(例如,基本选项卡中的hideInNav属性)。

此更改仅会影响一个页面呈现组件,因此我希望在/ apps / foundation / components / basicpage / v1 / basicpage /中覆盖基础页面对话框标签/基本。因此,我尝试使用sling:hideChildren,但没有设法使其正常工作。

<?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">
    <content jcr:primaryType="nt:unstructured">
        <items jcr:primaryType="nt:unstructured">
            <tabs jcr:primaryType="nt:unstructured">
                <items jcr:primaryType="nt:unstructured">
                    <basic jcr:primaryType="nt:unstructured">

                        <!-- that does not work either -->
                        <items jcr:primaryType="nt:unstructured" sling:hideChildren="*">
                            <column jcr:primaryType="nt:unstructured">
                                <items jcr:primaryType="nt:unstructured">
                                    <title jcr:primaryType="nt:unstructured">
                                        <items jcr:primaryType="nt:unstructured">

                                            <!-- that does not work -->
                                            <title jcr:primaryType="nt:unstructured" sling:hideProperties="*"/>
                                        </items>
                                    </title>

                                    <!-- that does not work -->
                                    <moretitles
                                        cq:showOnCreate="{Boolean}false"
                                        cq:hideOnEdit="{Boolean}true"
                                        jcr:primaryType="nt:unstructured">
                                    </moretitles>
                                </items>
                            </column>
                        </items>
                    </basic>

                    <!-- that works -->
                    <advanced jcr:primaryType="nt:unstructured" sling:hideResource="{Boolean}true"/>
                </items>
            </tabs>
        </items>
    </content>
</jcr:root>

解决方法

好的,找到一个解决方案(针对AEM 6.4)。您必须将资源合并与覆盖一起使用:

对于将继承页面的属性与上级/上级页面的属性进行合并,绝对必须使用覆盖!并且需要绝对路径。

<basic jcr:primaryType="nt:unstructured" path="/mnt/override/apps/[...]/components/basepage/tabs/basic"/>

标签的XML文件可以正常运行,并且可以使用sling:hideChildren和所有其他属性:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/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">
    <items jcr:primaryType="nt:unstructured">
        <column jcr:primaryType="nt:unstructured">
            <items jcr:primaryType="nt:unstructured">
                <title jcr:primaryType="nt:unstructured">
                    <items jcr:primaryType="nt:unstructured" sling:hideChildren="[hideinnav]" />
                </title>
                <moretitles jcr:primaryType="nt:unstructured">
                    <items jcr:primaryType="nt:unstructured" sling:hideChildren="[pagetitle,navigationtitle,subtitle]"/>
                </moretitles>
            </items>
        </column>
    </items>
</jcr:root>

来自Adobe的示例。这个提交帮助我了解了6.1和6.4之间的区别: https://github.com/Adobe-Marketing-Cloud/aem-authoring-extension-page-dialog/commit/aaa6035c8cdfcfaeb5e2157be436e1fccfbe22db

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。