Is it possible to remove the “Upload MM Component” button from the SDL Tridion 2011 Ribbon

梦想与她 提交于 2019-12-30 18:44:32

问题


This button causes a lot of problems for my client, as it always uses a predefined Schema. I can't find a way to remove this button with my Editor config. I have done this with other buttons, but these buttons are implemented in some sort of sub-group.

On my personal sandbox machine, I tried removing the commented out control in the extract of the ../WebUI/Editors/CME/Controls/Toolbars/Tabs/CreateRibbonPage.ascx file shown below:

<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>

This seems to have the desired result, but I imagine that this will probably invalidate our support agreement if I did this in a customer environment. Is this possible to do in a supported way, or do I have to hack the UI files like this to achieve my goal?


回答1:


One of the solutions is to create extension for the NewBasicMultimediaComponent command, which extends isAvailable and isEnabled methods and returns false for them. In this case "Upload MM Component" still will be present as an option for "New Component" button, but it will be disabled.




回答2:


I've used css to hide the display of ribbon items before. Purely because I couldn't find the appropriate solution.




回答3:


I'm adding this answer because I needed to do something similar with a complete ribbon toolbar.

I needed to remove the complete ribbon toolbar "Create" in order to add a simpler version of it and it seems you can do the removal part by creating a new extension and use this in your extensions config:

<?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>

To make this work for buttons you probably can do the same thing (haven't tested this), by providing the button id in the ext:extension id attribute.



来源:https://stackoverflow.com/questions/10703177/is-it-possible-to-remove-the-upload-mm-component-button-from-the-sdl-tridion-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!