gpt4 book ai didi

tridion - Tridion GUI 扩展命令集如何映射到 js 方法?

转载 作者:行者123 更新时间:2023-12-04 17:26:06 25 4
gpt4 key购买 nike

Tridion GUI 扩展配置如何将名称映射到 JS 文件?例如,我正在使用 Jaime 的 HelloWorld post带有示例文件。感觉最重要的部分是 CommandSet 部分。

<cfg:commandset id="HelloWorldCM.Interface">   
<cfg:command name="HelloWorldCM" implementation="Extensions.HW"/>
<cfg:dependencies>
<cfg:dependency>HelloWorldCM.Commandset</cfg:dependency>
</cfg:dependencies>
</cfg:commandset>

有人可以帮助我理解以下属性以及它们如何映射到扩展的底层 .js 文件吗?
  • 姓名
  • 实现
  • cfg:依赖

  • 我曾尝试在 config 和 js 文件中更改这些内容,但它们如何映射是一个谜。

    最佳答案

    您提到的三个属性实际上都是将整个扩展联系在一起的指针。如果您在 Jamie 的示例中查看更高的位置,您会看到:

    <ext:contextmenus>
    <ext:add>
    <ext:extension name="HelloWorldCMExtension" assignid="" insertbefore="cm_refresh">
    <ext:menudeclaration>
    <cmenu:ContextMenuItem id="ext_HelloWorldCM" name="Hello World!" command="HelloWorldCM"/>
    </ext:menudeclaration>
    <ext:dependencies>
    <cfg:dependency>HelloWorldCM.Example</cfg:dependency>
    </ext:dependencies>
    <ext:apply>
    <ext:view name="DashboardView"/>
    </ext:apply>
    </ext:extension>
    </ext:add>
    </ext:contextmenus>

    此 XML 向 CME 的上下文菜单添加了一个按钮。
    command="HelloWorldCM"指具有匹配 name 的命令 commandset 中的属性
    implementation="Extensions.HW"在命令集中实际上是指随附的 HellowWorldCM.js 文件中的命名空间
    cfg:dependency指向配置文件顶部 <cfg:group name="HelloWorldCM.Commandset" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">节点,以便知道要包含哪些 CSS 和 JS。

    关于tridion - Tridion GUI 扩展命令集如何映射到 js 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9393851/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com