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.

Archive /

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

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

TinyMCE and multiple Content fields


Reply


3 Posts   1942 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 :)