I am setting up my first Silver Stripe site after doing the tutorials, and the Layouts are not working for me. I have a Page.ss and Layout/Page.ss, and I am using $Layout to include the layout in the main template. When I go to a Page, there is no HTML coming through from the Layout file. I cannot find any differences between the tutorial and my code.
Can anyone help me?
mysite/code/Page.php:
<?php
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
}
class Page_Controller extends ContentController {
public function init() {
parent::init();
}
}
?>
themes/sunfresh/templates/Page.ss:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<% base_tag %>
<title><% if MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> » Your Site Name</title>
$MetaTags(false)
<link rel="shortcut icon" href="/favicon.ico" />
...
</head>
<body>
<div id="container">
<div id="header">
<div id="topmenu">
<% include Navigation %>
</div>
</div>
<div id="menu_bg">
<div id="menu">
<% include Menu %>
</div>
</div>
<div id="holder">
$Layout
</div>
<div class="clearfooter"></div>
</div>
<div id="footer">
<% include Footer %>
</div>
</body>
</html>
themes/sunfresh/templates/Layout/Page.ss:
<div id="content">
$Content
</div>
<div id="submenu">
<% include SubMenu %>
</div>
View Source:
...
</div>
<div id="holder">
</div>
<div class="clearfooter"></div>
...