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.

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

New homepage type


Go to End


2 Posts   1267 Views

Avatar
dubh

Community Member, 1 Post

24 March 2009 at 6:17am

I have created a HomePage.php file in the mysite/code directory with the following code

<?php
/**
* Defines the HomePage page type
*/

class HomePage extends Page {
static $db = array(
);
static $has_one = array(
);

}

class HomePage_Controller extends Page_Controller {

}
?>

However once I run the http://localhost/db/build?flush=1 and the database is changed I am unable to save and publish a page with the new HomePage type. When i click on the save and publish button I get "javascript Parse Error". Does anyone have any ideas?

Thanks

Avatar
Double-A-Ron

Community Member, 607 Posts

25 March 2009 at 5:37pm

I don't see a problem with that code at all.

Are you sure your db/build/flush=1 added the correct data (lines in green)?

You could also try clearing your cache.

Aaron