Todo: page for templates
As the Page template advances it can be split into two parts. First, a part that contains the features like the header, side-bar, and footer. Second, a part that contains the content that is specific to the page type, which lives in the sub-folder templates/Layout
. (The Layout
folder may be preceded by namespace related folders.) Using the example from [2], abbreviated. The HomePage class in HomePage.php is derived from the Page class defined in Page.php. If there is no
Inside the /app/templates folder, a simple html page named Page.ss
will link by name to the “Page” page type (and yes, way too many things are called “Page”).
<html>
<body>
<h1>Hello, world</h1> Todo - add $content
</body>
</html>
Whenever things change, update the configuration by adding ?flush
to the end of the URL (e.g. art.rainshowers.org/?flush
).
/app/templates/Page.ss
<html>
<head>
...
</head>
<body>
<header>
...
</header>
$Layout
</body>
</html>
/app/templates/Layout/HomePage.ss
<div>
<!-- stuff for the title and breadcrumb -->
</div>
<div>
<!-- main content -->
<!-- further variables to supply content from the framework -->
</div>
References: [2] https://www.silverstripe.org/learn/lessons/v4/working-with-multiple-templates-1