Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » CMS Field titles not showing up. --TextareaField--

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: 1937 Views
  • seagull
    Avatar
    Community Member
    17 Posts

    CMS Field titles not showing up. --TextareaField-- Link to this post

    Have a look at the attached picture, The field names won't appear for the two TextareaField's that I'm trying to create in the 'Place' tab, my Page.php code is below.

    class Page extends SiteTree {
       static $db = array(
       'HorizontalSpace' => 'HTMLText',
       'VerticalSpace' => 'HTMLText'
       );
       static $has_one = array(
    );

       function getCMSFields() {
        $fields = parent::getCMSFields();
       
        $fields->addFieldToTab('Root.Content.Place', new TextareaField('VerticalSpace'), 'Content');
        $fields->addFieldToTab('Root.Content.Place', new TextareaField('HorizontalSpace'), 'Content');
           
        return $fields;
       }

    }

    any suggestions? the titles appear when I use TextField

  • seagull
    Avatar
    Community Member
    17 Posts

    Re: CMS Field titles not showing up. --TextareaField-- Link to this post

    I get a positive result using TextField, picture attached

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: CMS Field titles not showing up. --TextareaField-- Link to this post

    This is an inconsistency with the API for TextareaField, as opposed to TextField.

    $fields->addFieldToTab('Root.Content.Place', new TextareaField('VerticalSpace', 'VerticalSpace'), 'Content');

    That should get you the label, just pass in the second argument.

    Sean

    1937 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.