我正在创建一个C#TBB(C#代码片段).为此,我需要编写一个用户定义的方法.我尝试使用<%创建它!%>.如何在代码中访问用户定义的方法.提前致谢.请建议我解决这个问题的方法.
我有一串XML格式.如下所示:
<gt>
<st>sample1</st>
<tt>sample2</tt>
<tt>sample3</tt>
</gt>
Run Code Online (Sandbox Code Playgroud)
我需要在Java脚本文件中获取节点值.我怎样才能获得价值?
我为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)
但对于简单的文本字段,需要使用哪个命令?
请帮忙解决这个问题.提前致谢.
我正在创建一个C#TBB.我有如下所示的XML代码.
<content>
<ah>123</ah>
<ph>456</ph>
<body>
<sc>hi</sc>
<value>aa</value>
<value>bb</value>
<value>cc</value>
<value>dd</value>
<value>dd</value>
</body>
<body>
<sc>hello</sc>
<value>ee</value>
<value>ddff</value>
</body>
</content>
Run Code Online (Sandbox Code Playgroud)
C#TBB代码:
using (MemoryStream ms = new MemoryStream())
{
XmlTextWriter securboxXmlWriter = new XmlTextWriter(ms, new System.Text.UTF8Encoding(false));
securboxXmlWriter.Indentation = 4;
securboxXmlWriter.Formatting = Formatting.Indented;
securboxXmlWriter.WriteStartDocument();
securboxXmlWriter.WriteStartElement("component");
securboxXmlWriter.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
securboxXmlWriter.WriteAttributeString("xmlns", "http://www.w3.org/1999/xhtml");
securboxXmlWriter.WriteStartElement("content");
securboxXmlWriter.WriteStartElement("wire:wire");
securboxXmlWriter.WriteStartElement("wire:si");
securboxXmlWriter.WriteStartElement("wg:ah");
securboxXmlWriter.WriteElementString("text", package.GetValue("Component.ah"));
securboxXmlWriter.WriteEndElement();
securboxXmlWriter.WriteStartElement("wg:ph");
securboxXmlWriter.WriteElementString("nlt", package.GetValue("Component.ph"));
securboxXmlWriter.WriteEndElement();
securboxXmlWriter.WriteEndElement();
securboxXmlWriter.WriteEndElement();
securboxXmlWriter.WriteEndElement();
securboxXmlWriter.WriteEndElement();
securboxXmlWriter.WriteEndDocument();
securboxXmlWriter.Flush();
securboxXmlWriter.Close();
Item output = package.GetByName("Output");
if (output != null)
{
package.Remove(output);
}
package.PushItem("Output", package.CreateStringItem(ContentType.Xml, Encoding.UTF8.GetString(ms.ToArray())));
}
Run Code Online (Sandbox Code Playgroud)
在XML代码中,"body"标签多次出现.我需要提取每个"body"标签内容.为此,我使用的是HTML敏捷包.为了使它在C#TBB中工作,如何将HTML敏捷包DLL添加到Tridion系统?还请提供html敏捷性的示例代码片段,以循环遍历body标签.
如果HTML …
我正在实现一个用于组件视图的功能区工具栏按钮.
当我单击RTF字段时,将启用该按钮.当我点击按钮时,它将打开一个aspx页面.打开aspx页面时,默认情况下应初始化相应的JavaScript.但就我而言,它并没有发生.
我给JavaScript和aspx页面提供了通用名称.请建议如何调试此问题并获得解决方案.
作为将Button添加到功能区工具栏的一部分.我需要Button java脚本文件中的模式名称.所以我试图使用以下命令来获取架构对象.
$display.getView().getItem().getSchema();
Run Code Online (Sandbox Code Playgroud)
上面的命令将返回架构对象.但是如何从架构对象中获取架构标题.请帮我解决这个问题.提前致谢.早期的反应表示赞赏.
我正在自定义功能区工具栏并为其添加一个按钮.每当我点击该按钮时,它将打开一个aspx页面,允许作者选择一些数据,这些数据会附加到现有的RTF字段内容中.
但是当弹出窗口打开时,它在浏览器(Internet Explorer)中出现以下错误.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Thu, 5 Apr 2012 12:18:35 UTC
Message: 'Tridion' is undefined
Line: 1
Char: 1
Code: 0
URI: http://172.21.188.26:2694/WebUI/Core/stringresources.js
Run Code Online (Sandbox Code Playgroud)
我找不到指定位置的stringresources.js文件.请建议我解决问题的方法.
ButtonReference.js文件:Type.registerNamespace("RTFExtensions.Commands");
RTFExtensions.Commands.ButtonReference = function Commands$ButtonReference(name) {
Type.enableInterface(this, "RTFExtensions.Commands.ButtonReference");
this.addInterface("Tridion.Cme.Command", [name || "ButtonReference"]);
this.addInterface("Tridion.Cme.FaCommand", [name || "ButtonReference"]);
};
RTFExtensions.Commands.ButtonReference.prototype._isAvailable = function ButtonReference$_isAvailable(target) {
if (target.editor.getDisposed()) {
return false;
}
return true; …Run Code Online (Sandbox Code Playgroud) 我在Tridion 2011 SP1的功能区工具栏中添加了一个按钮.当我点击按钮时,它将打开一个aspx页面.在aspx页面旁边,我需要访问当前光标所在的当前字段名称.请告诉我使用哪个对象?对于我使用的模式名称$display.getView().getItem().getSchemaId().同样有没有办法得到当前的字段名称?
我为Tridion 2011 SP1实现了一个功能区工具栏按钮,它打开一个aspx页面并根据查找组件填充下拉列表.查找组件包括不同的嵌入式模式.要根据嵌入式模式名称过滤掉值,我需要在按钮JavaScript中单击按钮时获取组件创建页面的嵌入式模式字段值.
因为在我的组件创建页面中包含多值嵌入式架构字段有信息,这有助于查找值过滤过程.我不知道该命令需要用于该要求.我知道一个获取完整组件XML的命令,即:$display.getView().getItemFields().
要获得当前的RTF字段内容,我将使用命令:target.editor.getHTML().要仅获取完整的嵌入式架构字段值,我需要使用哪个命令?
我的示例组件来源:
<root>
<a>sample a</a>
<b>sample b</b>
<c>
<ca>ca 1</ca>
<cb>cb 1</cb>
<cc>cc 1</cc>
</c>
<c>
<ca>ca 2</ca>
<cb>cb 2</cb>
<cc>cc 2</cc>
</c>
<c>
<ca>ca 1</ca>
<cb>cb 1</cb>
<cc>cc 1</cc>
</c>
</root>
Run Code Online (Sandbox Code Playgroud) 如何在页面中包含/引用动态组件模板.我创建了一个动态CT并发布了它,但想在页面中呈现它的演示文稿.请建议.
提前致谢,
tridion ×9
tridion-2011 ×4
javascript ×3
c# ×2
xml ×2
dom ×1
html-parsing ×1
jquery ×1
xpath ×1