I am working on a test theme for a client. He would like to migrate a large number of web sites but isn't sure that SilverStripe is the way to go. This is the first time I have used SilverStripe. Anyway, I've been following along in the Building a Basic Site tutorial on creating the layouts.
I created my own template by copying the tutorial folder over and for the most part that seemed to work fine. In fact Page.ss works like a charm. But I have pretty much run into a brick wall on the HomePage page-type and layout. I created my HomePage.ss file in templates and it seemed to work alright after awhile. However, I created my layout file and removed the HomePage.ss file and added $Layout to the Page.ss and the only page I can get to work is the Page.ss.
I created two page types to test the first one is the HomePage:
Here is the code I have for that:
<?php
class HomePage extends Page {
static $db = array(
);
static $has_one = array(
);
}
class HomePage_Controller extends Page_Controller {
}
My Page.ss file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<% base_tag %>
<link rel="stylesheet" type="text/css" href="tutorial/css/layout.css" />
<link rel="stylesheet" type="text/css" href="tutorial/css/typography.css" />
<link rel="stylesheet" type="text/css" href="tutorial/css/form.css" />
</head>
<body>
<div id="Main">
<% include Header %>
<div id="ContentContainer">
$Layout
</div>
<% include Footer %>
</div>
$SilverStripeNavigator
</body>
</html>
My HomePage.ss file:
<div id="Content" class="typography">
$Content
</div>
Really basic.
Anyway, I have done the dev/build?flush=all repeatedly and it is not improving the response. If I have the Page type set as Home Page I receive a completely empty page. No style information in the head and no content or body information.
I have a MenuPage type which is virtually identical to the HomePage. When I have the Page Type set to Menu Page I actually get content but all the style information is gone and I receive this message: Generated with the default ContentController.ss template.
Any thoughts as to why the Layout does not appear to be working?