Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

[solved] Removing Tab from SSMedia PopUp


Go to End


2 Posts   1619 Views

Avatar
Silverfish

Community Member, 59 Posts

26 December 2013 at 11:39pm

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

Community Member, 59 Posts

27 December 2013 at 5:06am

Edited: 27/12/2013 5:07am

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