如何弹出insertcomponentpresentation窗口?

SDL*_*ner 3 tridion tridion-2011

我想在我的自定义aspx页面中显示"插入组件演示"功能(单击"插入CP"按钮将弹出该页面)

  1. 创建自定义按钮"插入CP"(完成)
  2. 当用户从富文本框中选择任何文本并单击该按钮时,我需要打开一个窗口,用户可以在其中选择组件和组件模板.

任何人都可以提出建议/想法如何将窗口带到用户可以选择组件和组件模板的位置(例如,当用户打开页面时,导航到组件显示选项卡,当他单击"插入"按钮时,相同的功能是我正在从组件富文本框中查找.)

Fra*_*len 10

看看ComponentPresentations.js,它打开弹出窗口:

Tridion.Cme.ComponentPresentationsTab.prototype.onInsertClick = 
             function ComponentPresentationsTab$onInsertClick()
{
    var p = this.properties;
    if (p.insertDialog.isOpen())
    {
        p.insertDialog.focus();
    }
    else
    {
        p.insertDialog.open();
    }
};
Run Code Online (Sandbox Code Playgroud)

在此之前,它当然需要确保p.insertDialog已经正确初始化,它在其_initializeInsertDialog方法中执行.我不会在这里重现代码,因为你可以查找它并且它受版权保护的材料(我假设只是复制上面的片段在某种程度上属于合理使用).


注意:我得到了这个答案:

  1. 右键单击"页面"弹出窗口的"组件演示文稿"选项卡上的"插入"按钮
  2. 选择"检查元素"
  3. 记录元素的id(buttonComponentInsert在这种情况下)
  4. web\WebUI我的Tridion安装文件夹的子目录中搜索该值

这导致了一个名为ComponentPresentations.js的文件中的单击:

buttons.Insert = $controls.getControl($("#buttonComponentInsert"),
                                      "Tridion.Controls.Button");
Run Code Online (Sandbox Code Playgroud)

鉴于这是将HTML按钮转换为功能控件的地方,其余部分只是跟踪ComponentPresentation.js中该按钮发生的事情.