编辑时显示组件名称

时间:2014-04-08 15:27:05

标签: cq5

如何向编辑/作者显示组件的名称/标题,以便他们可以查看他们正在编辑的组件?

2 个答案:

答案 0 :(得分:2)

确保您的组件有一个“_cq_editConfig.xml”文件,其中包含以下内容:

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
      cq:actions="[text:Your Component Name,-,edit,delete,copymove,-,insert]"
      cq:dialogMode="floating"
      jcr:primaryType="cq:EditConfig">
</jcr:root>

请注意,在 cq:actions 属性中,您可以输入组件的名称。

答案 1 :(得分:1)

在_cq_editConfig.xml文件中,cq:actions属性可用于提供组件名称和其他按钮选项。

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    cq:actions="[text:[Component Name],editannonate,-,copymove,delete,-,insert]"
    cq:dialogMode="floating"
    cq:disableTargeting="{Boolean}true"
    cq:inherit="{Boolean}true"
    cq:layout="editbar"
    jcr:primaryType="cq:EditConfig"/>

此外,如果要禁用组件上的右键单击行为并显示编辑栏,请使用属性 cq:layout =&#34; editbar&#34;

可以更改动作序列。操作由逗号(,)分隔。对于动作之间的分隔符,使用&#34; - &#34;。