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.

Customising the CMS /

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

Custom Field Not Appearing


Go to End


2 Posts   1027 Views

Avatar
SilverstripeNewbie

Community Member, 14 Posts

5 October 2015 at 1:24am

Edited: 05/10/2015 1:58am

Why is my custom fields not appearing on the CMS? I run dev/build but stil not appearing?

<?php

class FieldPage extends Page {

private static $db = array (
'Field1' => 'Varchar(32)',
'Field2' => 'Varchar(32)'
);

public function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Main', TextField::create('Field1', 'Field 1'));
$fields->addFieldToTab('Root.Main', TextField::create('Field2', 'Field 2'));

return $fields;
}
}

class FieldPage_Contoller extends Page_Controller {

}

Avatar
SilverstripeNewbie

Community Member, 14 Posts

5 October 2015 at 2:24am

Never mind about this post I solved it.