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 fields don't show up in CMS


Go to End


2 Posts   1963 Views

Avatar
somaboy

Community Member, 8 Posts

7 March 2009 at 12:17am

Hi,

Quite new to the CMS, and i'm stuck.

I created a new page type that extends the default Page class (as included in the tutorial). But extra fields I define in the class don't show up in the CMS. I rebuilt the DB after uploading the file, flushed the cache, even tried manually removing cache files, but no cigar.

I'm probably missing some small but essential detail. Here's my code:

<?php
/**
 * Defines the Mening page type
 */
 
class Mening extends Page {
   static $db = array(
		'IntroTitel' => 'Varchar(255)',
		'IntroTekst' => 'Text'
   );
   static $has_one = array(
   );
 
}

function getCMSFields() {
   $fields = parent::getCMSFields();
 
   $fields->addFieldToTab('Root.Content.Main', new TextField('IntroTitel'), 'Content');
   $fields->addFieldToTab('Root.Content.Main', new TextAreaField('IntroTekst'), 'Content');
    	
   return $fields;
}
 
class Mening_Controller extends Page_Controller {
	
}
?>

thanks!

Avatar
AlaVive

Community Member, 42 Posts

5 August 2009 at 6:37am

Was there ever any solution to this? I'm having the same problem... Nothing I've tried works. I DID have success with the home page type, but everything since is failing to show in the CMS.

There's probably a simple solution, but I've not yet found it in the forums (though, I am learning quite a few other things!).