我为Tridion 2011 sp1版本的Format页面实现了一个Ribbon工具栏按钮.现在我的要求是将功能区按钮移动到主页 - 编辑组并使其工作.为此,我将pageid更改为"FormatPage",将groupid更改为"EditGroup".它在主页中启用.对于格式页面RTFfield,我使用了"FaCommand".对于需要使用哪个命令的主页简单文本字段?配置.码:
<ext:extension assignid="EditGroup" pageid="HomePage" name="RTF Extensions">
<ext:group/>
<ext:apply>
<ext:view name="ComponentView">
<ext:control id="ItemToolbar"/>
</ext:view>
</ext:apply>
</ext:extension>
<!-- BUTTONS -->
<ext:extension pageid="HomePage" groupid="EditGroup"
name="Ribbon<br/>Button" assignid="InsertAttribute">
<ext:command>InsertAttribute</ext:command>
<ext:title>Ribbon Button</ext:title>
<ext:dependencies>
<cfg:dependency>InsertAttributeExtension.InsertAttribute.Commands</cfg:dependency>
</ext:dependencies>
<ext:apply>
<ext:view name="ComponentView">
<ext:control id="ItemToolbar"/>
</ext:view>
</ext:apply>
</ext:extension>
Run Code Online (Sandbox Code Playgroud)
我的按钮javascript:
Type.registerNamespace("RTFExtension.Commands");
RTFExtension.Commands.IA = function Commands$IA(name) {
Type.enableInterface(this, "RTFExtension.Commands.IA");
this.addInterface("Tridion.Cme.Command", [name || "IA"]);
this.addInterface("Tridion.Cme.FaCommand", [name || "IA"]);
};
Run Code Online (Sandbox Code Playgroud)
对于我使用的FormatPage和RTF字段
FACommand
Run Code Online (Sandbox Code Playgroud)
但对于简单的文本字段,需要使用哪个命令?
请帮忙解决这个问题.提前致谢.
我在Tridion 2011 SP1的功能区工具栏中添加了一个按钮.当我点击按钮时,它将打开一个aspx页面.在aspx页面旁边,我需要访问当前光标所在的当前字段名称.请告诉我使用哪个对象?对于我使用的模式名称$display.getView().getItem().getSchemaId().同样有没有办法得到当前的字段名称?