CQ5:继承/扩展对话框 [英] CQ5: Inheriting/Extended Dialogs

查看:75
本文介绍了CQ5:继承/扩展对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为参考,我使用的是CQ5.5

For reference, I'm on CQ5.5

我很好奇是否有任何方法可以扩展继承的对话框,而不会覆盖其父对话框。

I am curious if there is any way to extend upon an inherited dialog, without overwriting it's parent dialog.

例如,具有以下结构:

base-page-template
   - dialog
      - title
      - description

inerited-from-base-page
   - dialog
      - custom field
      --------------- [inherited from parent]
      - title
      - description

例如,我要避免的是:我需要向基础页面添加一个新属性,该属性应显示在从基础页面扩展的所有页面模板上。我当前的解决方案是将该属性分别添加到所有对话框。因此,例如,在上述结构中,我必须将新的默认属性添加到基本页面对话框和继承自基本页面对话框中。

What I'm trying to avoid is for example: I need to add a new property to base-page that should show up on all page templates that extend from base-page. My current solution is to add that property to all dialogs separately. So for example, in the above structure I would have to add the new "default property" to both the base-page and the inherited-from-base-page dialogs.

我唯一想到的另一种选择是创建一个表示基本页面的面板节点,然后包括一个带有xtype:cqinclude节点的面板。

The only other option I could think of was creating a panel node that represents "base page" and then including that panel w/ an xtype:cqinclude node.

对于后一种方法,我很好奇是否有人以我上面描述的方式扩展了他们的对话框。

Before going with the latter route I'm curious if anyone has extended their dialogs in the fashion I'm describing above.

任何帮助将不胜感激,谢谢,
Brodie

Any help is greatly appreciated, Thank you, Brodie

推荐答案

否,无法直接继承对话框。最好的办法是使用path属性包含对话框选项卡。

No, there is no way to directly inherit dialogs. The best you can do is to include the dialog tabs using path property.

您应在其他位置创建选项卡,然后使用以下方法将其包含在对话框中路径属性,如下所示:

You should create your tab your tabs in a different location and you can include it in your dialog using path property like shown below:

<items jcr:primaryType="cq:WidgetCollection">
        <tabs jcr:primaryType="cq:TabPanel">
            <items jcr:primaryType="cq:WidgetCollection">
                <tab1
                        jcr:primaryType="cq:Widget"
                        path="/apps/myproject/tab1.infinity.json"
                        xtype="cqinclude"/>
                <tab2
                        jcr:primaryType="cq:Widget"
                        path="/apps/myproject/tab2.infinity.json"
                        xtype="cqinclude"/>

            </items>
        </tabs>
</items>    

其中tab1和tab2是选项卡面板。

Where tab1 and tab2 are tab panels.

因此,在您的情况下,将是这样的:

So, in your case it will be something like this :

base_page_dialog_tab
      - dialog
      - title
      - description

inherited page-dialog-tab
      - custom field


base-page-template
    - include base page dialog tab here.   

inerited-from-base-page
    - include Tab 1 - inherited page-dialog tab using path property 
    - include Tab 2 - base page dialog tab using path property.

这篇关于CQ5:继承/扩展对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆