Tridion GUI 扩展命令集如何映射到 js 方法? [英] How does the Tridion GUI Extensions CommandSet map to js methods?
问题描述
Tridion GUI 扩展配置如何将名称映射到 JS 文件?例如,我正在使用 Jaime 的 HelloWorld 帖子 带有示例文件.感觉最重要的部分是 CommandSet 部分.
How does the Tridion GUI Extension config map the names to the JS file? For example, I am using Jaime's HelloWorld post with example files. The most important part feels to be the CommandSet section.
<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 文件吗?
Can someone please help me understand the following attributes and how they map to the underlying .js file for the extension?
- 姓名
- 实施
- cfg:依赖
我已经尝试在 config 和 js 文件中更改这些内容,但它们是如何映射的还是个谜.
I have tried changing these things in both config and js file but how they are mapped is a mystery.
推荐答案
您提到的三个属性实际上都是将整个扩展联系在一起的指针.如果您在 Jamie 的示例中向上看,您会看到:
The three attributes you mention are really all pointers that tie the whole extension together. If you look higher up in the Jamie's sample, you will see this:
<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 的上下文菜单添加了一个按钮.
This XML adds a button to the CME's context menu.
command="HelloWorldCM"
指的是 commandset
implementation="Extensions.HW"
实际上是指随附的 HellowWorldCM.js 文件中的命名空间
implementation="Extensions.HW"
in the command set actually refers to the namespace in the accompanying HellowWorldCM.js file
cfg:dependency
指向配置文件顶部的 <cfg:group name="HelloWorldCM.Commandset" merge="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">
节点,以便知道要包含哪些 CSS 和 JS.
cfg:dependency
points to the top of the config file at the <cfg:group name="HelloWorldCM.Commandset" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">
node in order to know which CSS and JS to include.
这篇关于Tridion GUI 扩展命令集如何映射到 js 方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!