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

Overloading requireDefaultRecords for Home

Go to End

2 Posts   1155 Views


Community Member, 545 Posts

20 December 2012 at 5:53am

Is there anyway to change the PageType for Home in the requireDefaultRecords() to differnt page type other than Page without editing the core file?


Forum Moderator, 5523 Posts

20 December 2012 at 8:10pm

Sure, requireDefaultRecords is run once per class so on your Page.php

function requireDefaultRecords() {

$home = DataObject::get_one("Page", "URLSegment = 'home'");
$home->ClassName = "NewSomethingClass";
$home->publish('Stage', 'Live');