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.

General Questions

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

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

New homepage type


Reply

2 Posts   753 Views

Avatar
dubh

24 March 2009 at 6:17am Community Member, 1 Post

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

25 March 2009 at 5:37pm Community Member, 604 Posts

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