2012-05-22 21 views
6

此按鈕會爲我的客戶端帶來很多問題,因爲它始終使用預定義的架構。我找不到用我的編輯器配置刪除此按鈕的方法。我已經用其他按鈕完成了這些操作,但這些按鈕是在某種子組中實現的。是否可以從SDL Tridion 2011功能區刪除「上傳MM組件」按鈕

在我的個人沙機,我試圖消除在../WebUI/Editors/CME/Controls/Toolbars/Tabs/CreateRibbonPage.ascx文件的摘錄如下所示註釋掉控制:

<c:RibbonSplitButton runat="server" CommandName="NewComponent" 
    Title="<%$ Resources: Tridion.Web.UI.Strings, NewComponent %>" 
    Label="<%$ Resources: Tridion.Web.UI.Strings, NewComponent %>" 
    ID="NewComponentBtn1"> 
    <c:RibbonContextMenuItem runat="server" ID="NewComponentCMI2" 
    Command="NewComponent" 
    Title="<%$ Resources: Tridion.Web.UI.Strings, NewComponent %>" 
    Label="<%$ Resources: Tridion.Web.UI.Strings, NewComponent %>" /> 
    <c:RibbonContextMenuItem runat="server" ID="NewMultimediaComponentCMI2" 
    Command="NewMultimediaComponent" 
    Title="<%$ Resources: Tridion.Web.UI.Strings, NewMultimediaComponent %>" 
    Label="<%$ Resources: Tridion.Web.UI.Strings, NewMultimediaComponent %>" /> 
    <!-- 
    <c:RibbonUploadContextMenuItem runat="server" 
    ID="NewBasicMultimediaComponentCMI2" Command="NewBasicMultimediaComponent" 
    Title="<%$ Resources: Tridion.Web.UI.Strings, NewBasicMultimediaComponent %>" 
    Label="<%$ Resources: Tridion.Web.UI.Strings, NewBasicMultimediaComponent %>" /> 
    --> 
</c:RibbonSplitButton> 

這似乎有理想的結果,但我想如果我在客戶環境中這樣做,這可能會使我們的支持協議無效。這是否可能以受支持的方式進行,還是我必須像這樣破解UI文件才能實現我的目標?

+0

我的CME.config(T2011 SP1)有一個以<<! - 上傳按鈕設置(從文件創建mm組件)開始的註釋部分,它似乎設置了多媒體類型和模式設置。不過不確定這只是1:1映射。我有興趣將'New Component'組全部替換爲注意隱藏多媒體選項(兩個小按鈕,而不是下拉列表中的mm)。 –

回答

7

其中一個解決方案是爲NewBasicMultimediaComponent命令創建擴展,該命令擴展了isAvailableisEnabled方法併爲它們返回false。在這種情況下,「上傳MM組件」仍然會作爲「新組件」按鈕的一個選項出現,但它將被禁用。

6

我已經使用css來隱藏功能區項目的顯示。純粹是因爲我找不到合適的解決方案。

+0

可怕......但一個有趣的方法。感謝分享 –

+0

我也在Tridion PE中看到過這種方法。它似乎工作得很好,即使它不是我演示所需要的;) –

2

我添加了這個答案,因爲我需要用完整的功能區工具欄做類似的事情。

我需要取出完整帶狀工具欄上的「創建」,以增加它的簡化版本,它似乎你可以通過創建一個新的擴展做了切除一部分,並在您的擴展配置使用:

<?xml version="1.0"?> 
<Configuration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge" xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration" xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions" xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu" xmlns:edt="http://www.sdltridion.com/2009/GUI/Configuration/Merge"> 
    <resources> 
     <cfg:groups /> 
    </resources> 
    <definitionfiles /> 
    <extensions> 
     <ext:editorextensions> 
      <ext:editorextension target="CME"> 
       <ext:editurls /> 
       <ext:listdefinitions /> 
       <ext:itemicons /> 
       <ext:taskbars /> 
       <ext:commands /> 
       <ext:commandextensions /> 
       <ext:contextmenus /> 
       <ext:lists /> 
       <ext:tabpages> 
       </ext:tabpages> 
       <ext:toolbars> 
       </ext:toolbars> 
       <ext:ribbontoolbars> 
        <ext:remove> 
         <ext:extension id="CreatePage"> 
          <ext:apply> 
           <ext:view name="DashboardView"> 
            <ext:control id="DashboardToolbar" /> 
           </ext:view> 
          </ext:apply> 
         </ext:extension> 
        </ext:remove> 
       </ext:ribbontoolbars> 
       <ext:extendedareas /> 
      </ext:editorextension> 
     </ext:editorextensions> 
     <ext:dataextenders /> 
    </extensions> 
    <commands /> 
    <contextmenus /> 
    <localization /> 
    <settings> 
     <dependencies /> 
     <defaultpage /> 
     <editurls /> 
     <listdefinitions /> 
     <theme> 
      <path>/Themes/</path> 
     </theme> 
     <customconfiguration /> 
    </settings> 
</Configuration> 

爲了使這個按鈕的工作,你可能會做同樣的事情(還沒有測試過),通過在ext:extension id屬性中提供按鈕id。

相關問題