Jump to:

5552 Posts in 1742 Topics by 1226 members

Customising the CMS

SilverStripe Forums » Customising the CMS » HTML Text name now showing up

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

Page: 1
Go to End
Author Topic: 1198 Views
  • DanStephenson
    Community Member
    115 Posts

    HTML Text name now showing up Link to this post

    Hi everyone,

    I am setting up my first SilverStripe template. I've created a page with 2 custom fields, Sidebar, and Sidebar Feature. In the CMS, I can see that these text areas have been created, but they don't have any labels on them, so the admin knows what to enter. What did I do wrong?

    class Page extends SiteTree {
       static $db = array(
          'Sidebar' => 'HTMLText',
          'SidebarFeature' => 'HTMLText'
       static $defaults = array(

       function getCMSFields() {
          $fields = parent::getCMSFields();
          $fields->addFieldToTab('Root.Content.Sidebar', new HTMLEditorField('Sidebar'), 'Sidebar');
          $fields->addFieldToTab('Root.Content.Sidebar', new HTMLEditorField('SidebarFeature'), 'Sidebar Feature');   
          return $fields;

  • dio5
    Community Member
    501 Posts

    Re: HTML Text name now showing up Link to this post

    Your order of parameters is a bit wrong:


    $fields->addFieldToTab('Root.Content.Sidebar', new HTMLEditorField('Sidebar', 'Sidebar'));
    $fields->addFieldToTab('Root.Content.Sidebar', new HTMLEditorField('SidebarFeature', 'Sidebar Feature'));

    The argument you would put in where you had it originally, is to tell the Tab before which other field the new field should be inserted.

    Hope this helps.

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.