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

[Solved] Multiple "Content-Areas" in admin interface?


Reply


4 Posts   5202 Views

Avatar
slamby

Community Member, 21 Posts

28 May 2008 at 4:47am

Edited: 28/05/2008 7:48am

Is there a solution to provide multiple content - boxes to the one using the admin interface for text editing with the wysiwyg-editor?

The documentation for the fields which can be defined was looking good for the first moment and I was trying with field type "HTMLText" but this one just offers a one line input field for html code.

Any ideas?
Thanks for your help.

Avatar
newjamie

Community Member, 7 Posts

28 May 2008 at 6:51am

You have to add an HTML editor field to the editor too, instead of a TextField in your getCMSFields() method, ie.

$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('YourFieldName','More content'));

Avatar
slamby

Community Member, 21 Posts

28 May 2008 at 7:49am

Thanks a lot.

This hint was the solution.

Avatar
mikewheaton

Community Member, 9 Posts

21 October 2008 at 7:47am

This is exactly what I was looking for, thanks!

For anyone who is unsure of where to place this, here is a portion of my 'CareerPage.php' (located within mysite/code):

class CareerPage extends Page {
   static $db = array(
      'Requirements' => 'HTMLText'
   );
   static $has_one = array(
   );
   
   function getCMSFields() {
      $fields = parent::getCMSFields();
      $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Requirements', 'Job Requirements'));
      return $fields;
   }
}