Creating a new page type

Earlier we stated that every page in a SilverStripe site has a page type, and that SilverStripe will look for a template corresponding to the page type. Therefore, the first step to get the homepage using a different template is to create a new page type.

Each page type is represented by two php classes: a data object and a controller. Don’t worry about the details of page types right now, we will go into much more detail in tutorial two.

Create a new file HomePage.php in tutorial/code. Copy the following code into it: