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

CMS Field titles not showing up. --TextareaField--


Reply


3 Posts   2013 Views

Avatar
seagull

Community Member, 17 Posts

3 May 2008 at 7:54pm

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

Avatar
seagull

Community Member, 17 Posts

3 May 2008 at 8:00pm

I get a positive result using TextField, picture attached

Avatar
Sean

Forum Moderator, 922 Posts

4 May 2008 at 12:57am

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