AEM 6.5.6 + 静态模板:如何在内置页面属性的现有字段集中添加其他字段?

问题描述

我在进行更改/测试时遵循了本教程/指南:tutorial link here按照本教程,我能够隐藏社交选项卡/WKND 页面模板中的内置/认字段之一。

我正在查看/libs/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/column/items/moretitles(该节点的内容如下所示)。我想在这个字段集中添加一个字段(用于我自己的项目而不是 WKND 示例项目),但它对我不起作用。

你能帮忙吗?谢谢

更新 1:

  • 当我将 sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage/tabs/basic" 添加到我的 basic.xml 时,事情开始对我有用。
  • 我尝试为高级选项卡做同样的事情,但它绝对不起作用。

作为测试,我尝试了两件事(在两个测试中,节点都保存在 /apps/myapp/components/page/base-page/cq:dialog/content/items/tabs/items/basic/items/列/项目/更多标题

  • 一个测试(这基本上是 /libs/../../moretitles 中 pageTitle 的副本,除了我附加了 1 并删除了 moretitles 标记的一些参数/属性

     <moretitles
         jcr:primaryType="nt:unstructured"
         <items jcr:primaryType="nt:unstructured">
         <pagetitle1
             cq:showOnCreate="{Boolean}true"
             jcr:primaryType="nt:unstructured"
             sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
             fieldLabel="Page Title1"
             name="./pageTitle1"
             renderReadOnly="{Boolean}true">
             <granite:data
                 jcr:primaryType="nt:unstructured"
                 allowBulkEdit="{Boolean}true"
                 cq-msm-lockable="pageTitle1"/>
         </pagetitle1>
     </moretitles>
    

    test1 的问题是我在页面创建和创建后(打开页面属性)看不到 pageTitle1,但我可以看到其他认字段(例如:navTitle)。

  • 第二个测试(这基本上是来自 /libs/../../moretitles 的 pageTitle 的副本,除了我附加了 1)

     <moretitles
         cq:showOnCreate="{Boolean}true"
         jcr:primaryType="nt:unstructured"
         jcr:title="More Titles and Description"
         sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
         <items jcr:primaryType="nt:unstructured">
         <pagetitle1
             cq:showOnCreate="{Boolean}true"
             jcr:primaryType="nt:unstructured"
             sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
             fieldLabel="Page Title1"
             name="./pageTitle1"
             renderReadOnly="{Boolean}true">
             <granite:data
                 jcr:primaryType="nt:unstructured"
                 allowBulkEdit="{Boolean}true"
                 cq-msm-lockable="pageTitle1"/>
         </pagetitle1>
     </moretitles>
    

    在第二次测试中,我终于可以在页面创建和创建后看到 pageTitle1(打开页面属性),但所有其他认字段(例如:navTitle)都消失了。似乎我已经覆盖/替换了它,而不是扩展更多标题

(/libs/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/column/items/moretitles的内容

<moretitles
    cq:showOnCreate="{Boolean}true"
    jcr:primaryType="nt:unstructured"
    jcr:title="More Titles and Description"
    sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
    <items jcr:primaryType="nt:unstructured">
        <pagetitle
            cq:showOnCreate="{Boolean}true"
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
            fieldLabel="Page Title"
            name="./pageTitle"
            renderReadOnly="{Boolean}true">
            <granite:data
                jcr:primaryType="nt:unstructured"
                allowBulkEdit="{Boolean}true"
                cq-msm-lockable="pageTitle"/>
        </pagetitle>
        <navigationtitle
            cq:showOnCreate="{Boolean}true"
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
            allowBulkEdit="{Boolean}true"
            fieldLabel="Navigation Title"
            name="./navTitle"
            renderReadOnly="{Boolean}true">
            <granite:data
                jcr:primaryType="nt:unstructured"
                allowBulkEdit="{Boolean}true"
                cq-msm-lockable="navTitle"/>
        </navigationtitle>
        <subtitle
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
            fieldLabel="Subtitle"
            name="./subtitle"
            renderReadOnly="{Boolean}true">
            <granite:data
                jcr:primaryType="nt:unstructured"
                allowBulkEdit="{Boolean}true"
                cq-msm-lockable="subtitle"/>
        </subtitle>
        <description
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
            fieldLabel="Description"
            name="./jcr:description"
            renderReadOnly="{Boolean}true">
            <granite:data
                jcr:primaryType="nt:unstructured"
                allowBulkEdit="{Boolean}true"
                cq-msm-lockable="jcr:description"/>
        </description>
    </items>
</moretitles>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)