sitecore中的自定义/编辑器选项卡顺序

时间:2015-07-02 23:45:11

标签: tabs sitecore

我正在尝试找到一种方法来更改sitecore自定义/编辑器标签的顺序。默认情况下,sitecore显示自定义选项卡,内容选项卡和动态选项卡,并根据

https://www.markstiles.net/Blog/2011/02/27/editor-tabs-in-sitecore.aspx

更改标签顺序的唯一方法是挖掘sitecore。 sitecore论坛也没有帮助。任何想法,如果这可以在sitecore中配置?上面提到的帖子很旧,从那以后可能已经改变了,但我还没有找到任何关于它的信息。

2 个答案:

答案 0 :(得分:1)

从Sitecore 8.0更新3开始,用于检索选项卡的sitecore代码仍然与添加存储桶选项卡相同:

取自Sitecore.Client.dll班级中的Sitecore.Shell.Applications.ContentManager.Editor

private static List<Editor.EditorTab> GetEditorTabs(Item item, Editor.Sections sections)
{
    Assert.ArgumentNotNull(item, "item");
    Assert.ArgumentNotNull(sections, "sections");
    List<Editor.EditorTab> editorTabs = new List<Editor.EditorTab>();
    Editor.GetCustomEditorTab(item, editorTabs);
    Editor.GetCustomEditorTabs(item, editorTabs);
    Editor.GetContentTab(item, sections, editorTabs);
    if (InternalSettings.ItemBucketsEnabled)
    {
        Editor.GetNewSearchTab(item, sections, editorTabs);
    }
    Editor.GetDynamicTabs(item, editorTabs);
    return editorTabs;
}

所以不幸的是,它看起来仍然是它们被渲染的顺序。正如文章所提到的,这可能会被覆盖,但可能会非常复杂。

答案 1 :(得分:0)

我实现了这一点略有不同。对解决方案不是100%满意,但它有效,直到有更好的选择。

在我的自定义标签中,当我选择项目时,它会显示为第一个标签,因此显示为活动标签。我添加了以下JavaScript代码,以将活动选项卡更改回标准Sitecore选项卡。

     parent.scContent.onEditorTabClick(this, null, "Content");

代码会转到父窗​​口,因为Tab是iFrame,并将活动标签设置为&#34; Content&#34;标签

我的自定义标签是在Sitecore 8上运行的SPEAK标签。以下是SPEAK javascript PageCode供参考。

https://github.com/sobek1985/SitecoreContentEditorTabs/blob/Complete/SitecoreContentEditorTabs/SitecoreContentEditorTabs.js

我写了一篇关于这个主题的博文:http://mikerobbins.co.uk/2015/07/14/sitecore-content-editor-tabs-in-speak/

相关问题