如何使用功能区工具栏按钮重定向到Tridion中的不同页面?

时间:2012-06-29 12:44:08

标签: tridion tridion-2011

实施功能区工具栏按钮。按钮单击取决于架构名称,我需要创建带有相应URL(Aspx页面)的弹出窗口。以前我只使用了一个aspx页面并且我成功了,我创建了一个与aspx页面同名的popup java脚本文件,并在配置文件中进行了配置。但是在多个aspx页面的情况下,即使我创建了多个弹出式javascript文件。它不会调用受尊重的javascript文件。

  

如果有多个aspx页面,如何将弹出的java脚本文件映射到aspx页面?

PFB代码样本。

Button java script file code fragment:

if (some condition) {
         //Creating the url    
         var url = "Editors/RTFExtension/Popups/ButtonReferencePopup_2.aspx?schemaId='" + schemaId + "'";
         var popup = $popup.create(url, "toolbar=no,width=500,height=200,resizable=yes,scrollbars=yes", null);
}
else{
        //Creating the url    
        var url = "Editors/RTFExtension/Popups/ButtonReferencePopup.aspx?schemaId='" + schemaId + "'";
        var popup = $popup.create(url, "toolbar=no,width=500,height=200,resizable=yes,scrollbars=yes", null);
}

Config file code fragment:

<cfg:group name="RTFExtension.ButtonReference">
        <cfg:fileset>          
          <cfg:file type="script">/Popups/ButtonReferencePopup.js</cfg:file>
          <cfg:file type="script">/Popups/ButtonReferencePopup_2.js</cfg:file>
          <cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
        </cfg:fileset>       

        <cfg:dependencies>
          <cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
          <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
          <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
        </cfg:dependencies>
</cfg:group>

请帮我解决这个问题。提前致谢。早期的回应表示赞赏。

1 个答案:

答案 0 :(得分:2)

我相信你需要为每个配置配置不同的组 - 如下所示:

<cfg:group name="RTFExtension.ButtonReference.Popup1">
    <cfg:fileset>          
      <cfg:file type="script">/Popups/ButtonReferencePopup.js</cfg:file>
      <cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
    </cfg:fileset>       

    <cfg:dependencies>
      <cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
    </cfg:dependencies>
</cfg:group>

<cfg:group name="RTFExtension.ButtonReference.Popup2">
    <cfg:fileset>          
      <cfg:file type="script">/Popups/ButtonReferencePopup_2.js</cfg:file>
      <cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
    </cfg:fileset>       

    <cfg:dependencies>
      <cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
    </cfg:dependencies>
</cfg:group>

在你的弹出式代码隐藏中,你需要引用相关的组:

namespace Button.Reference.Popups
{
    [ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
    [ControlResources("RTFExtensions.ButtonReference.Popup1")]
    public partial class PopupReference1 : TridionPage

或者:

namespace Button.Reference.Popups
{
    [ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
    [ControlResources("RTFExtensions.ButtonReference.Popup2")]
    public partial class PopupReference2 : TridionPage