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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

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


Go to End


3 Posts   2264 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