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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

TextField not displaying in CMS

Go to End

3 Posts   1126 Views


Community Member, 33 Posts

17 October 2009 at 3:52am


I wonder if somebody could help me out. I have a new Page Type, SupporterPage. It's basically the same as a normal Page with the addition of a website URL field:

class SupporterPage extends Page {
    static $db = array('SupporterWebsite' => 'Varchar(255)');
    static $has_one = array();

    static $icon = 'themes/VansBP/images/treeicons/supporter';

    public function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Content.Main', new TextField('SupporterWebsite'), 'Website');

        return $fields;

class SupporterPage_Controller extends Page_Controller {


Problem is, the SupporterWebsite field does not appear on the CMS page. I have rebuilt the database (/dev/build/?flush=1) and the tables have been created, with the correct field added. It's just the CMS field that won't show.

If I change the tab to something like Root.Content.Website, then a new tab gets created, but the field still does not show.

Anyone have any ideas - have I made a newb error?! ;)


Community Member, 191 Posts

17 October 2009 at 6:22am

new TextField('SupporterWebsite'), 'Website');

You're telling it to put a field above the Website field, which doesn't exist.

This will rename the field to "Supporter Website URL" and put it above the Content field. If you remove the Content reference, it will appear at the bottom.

new TextField('SupporterWebsite', 'Supporter Website URL'), 'Content');


Community Member, 33 Posts

19 October 2009 at 10:12pm

Hi Socks,

Thanks for the reply. Now that you point it out, it's quite obvious and I really should have picked up on my misplaced bracket.

Thanks for your help, much appreciated.