Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » [Solved] Multiple "Content-Areas" in admin interface?

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

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

Page: 1
Go to End
Author Topic: 5107 Views
  • slamby
    Avatar
    Community Member
    21 Posts

    [Solved] Multiple "Content-Areas" in admin interface? Link to this post

    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.

  • newjamie
    Avatar
    Community Member
    7 Posts

    Re: [Solved] Multiple "Content-Areas" in admin interface? Link to this post

    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'));

  • slamby
    Avatar
    Community Member
    21 Posts

    Re: [Solved] Multiple "Content-Areas" in admin interface? Link to this post

    Thanks a lot.

    This hint was the solution.

  • mikewheaton
    Avatar
    Community Member
    9 Posts

    Re: [Solved] Multiple "Content-Areas" in admin interface? Link to this post

    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;
       }
    }

    5107 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.