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

Can I get TinyMCE to work as HTMLEditorField in ComplexTableField


Go to End


6 Posts   3250 Views

Avatar
Jakxnz

Community Member, 36 Posts

2 December 2009 at 12:48pm

Hey guys,

Hopefully this is pretty self explanatory. When I add an HTMLEditorField to my CMS fields when I'm creating a new ComplexTableField and editing it via a Popup, it doesnt add the tinyMCE wysiwyg?

Is this strange? Or am I unable to use the tinyMCE editor inside a ComplexTableField Popup?

public function getCMSFields() {
		$fields = parent::getCMSFields();

		HTMLEditorField::include_js();

		$fields->removeByName('Content');

		$fields->addFieldsToTab('Root.Content', new FieldSet(
			new HTMLEditorField('Content', 'Content')
		));

		
		return $fields;

	}


	public function getCMSFields_forPopup() {
		return self::getCMSFields();	
	}

	public static function getCMSTableField($controller, $name) {
		
		$table = new ComplexTableField(
			$controller,
			$name,
			__CLASS__,
			null,
			'getCMSFields_forPopup',
			null,
			'Date DESC'
		);

...

Thanks for any help in advance :D

Avatar
bummzack

Community Member, 904 Posts

2 December 2009 at 8:34pm

Hi jdi

The HTMLEditorField doesn't work in popups. UncleCheese has several working WYSIWYG Editors bundled with his DataObjectManager module though:
http://doc.silverstripe.org/doku.php?id=simplewysiwygfield
http://doc.silverstripe.org/doku.php?id=simplehtmleditorfield
.. and also a SimpleTinyMCEField which uses TinyMCE as editor. The last one is the most recent addition and not (yet) on the doc wiki. I suggest you use the SimpleTinyMCEField, it seems to be the best of the three.

Avatar
Jakxnz

Community Member, 36 Posts

4 December 2009 at 11:12am

Hey Banal.

Thanks a lot for the info, worked a treat. Much appreciated.

Avatar
Mauro74

Community Member, 30 Posts

16 July 2012 at 10:03pm

Edited: 16/07/2012 10:03pm

Guys I need the WYSIWYG working in the pop up, I found this post but the 2 links about Uncle Cheese solution are dead. Do you know where I can find these stuff?

Thanks!

Avatar
martimiz

Forum Moderator, 1391 Posts

17 July 2012 at 3:02am

They're part of the DataobjectManager module - look under code:

https://github.com/unclecheese/DataObjectManager/

Avatar
swaiba

Forum Moderator, 1899 Posts

17 July 2012 at 4:46am

Personally I'd advise just using the new SS3 - that doesn't use the "popup" stuff anymore...