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.

Archive /

Our old forums are still available as a read-only archive.

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

TinyMCE and multiple Content fields


Go to End


3 Posts   2464 Views

Avatar
JGC

Community Member, 25 Posts

18 November 2008 at 6:43am

I'm trying to allow a user to edit multiple Content fields with the TinyMCE editor in a single page - for example, on the homepage there might be a Featured and a MainContent block.

The problem I'm finding is that TinyMCE will only apply formatting to ONE field (Content), and even if I add more with

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

		$fields->addFieldToTab('Root.Content.Main', new TextareaField('HPFeatured', 'Featured Content', 6), 'Content');

it's just ignoring them and using only the original Content field.

If I delete the Content field and re-create it, it won't insert any formatting.

Does anyone know how to apply formatting to other fields with TinyMCE through the admin panel?

Many thanks.

Avatar
Liam

Community Member, 470 Posts

18 November 2008 at 7:31am

You're using the wrong form type. You want htmleditorfield:

http://doc.silverstripe.com/doku.php?id=htmleditorfield

Avatar
JGC

Community Member, 25 Posts

18 November 2008 at 10:05pm

Hot damn. Found it out not long after I asked, and forgot to update the topic >_< Thanks anyway though :)