Jump to:

5514 Posts in 1733 Topics by 1219 members

Customising the CMS

SilverStripe Forums » Customising the CMS » [solved] Removing Tab from SSMedia PopUp

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 341 Views
  • Silverfish
    Avatar
    Community Member
    59 Posts

    [solved] Removing Tab from SSMedia PopUp Link to this post

    Hi there,

    if you enter a media into the Html Editor, you can choose where you want to get the media file from ('From your computer', 'From the web', 'From the CMS'), how could I remove one or two of these tabs? (see attached screenshot for further explanation).

    Would be very grateful for any hint!

    Whish you all happy holidays and an awesome new year!

    regards
    SF

    Attached Files
  • Silverfish
    Avatar
    Community Member
    59 Posts

    Re: [solved] Removing Tab from SSMedia PopUp Link to this post

    Hi,

    after spending hours of research, the answer is embarrassingly simple.
    Best hint was http://www.silverstripe.org/customising-the-cms/show/23497, thanx for that!

    I created an extension for the HtmlEditorField_Toolbar like:

    <?php

    class HtmlEditorField_ToolbarExtension extends DataExtension {

       public function updateMediaForm(Form $form) {
          $form->Fields()->removeByName('FromComputer');
          $form->Fields()->removeByName('FromCms');
       }

    }

    and included it in _config.php:

    Object::add_extension('HtmlEditorField_Toolbar', 'HtmlEditorField_ToolbarExtension');

    Regards
    SF

    341 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.