Adding $variable to a file rendered the variable contents in its place

Var can also be like: $Level(1).Title to retrieve the current top level page title

ie \tutorial\templates\

Element .. id="xxx" will style per xxx from  tutorial/css/layout.css

Do ?flush=1 to clear the cach after altering css file


They say:

Having two templates is good, but we have a lot of identical code in the two templates. Rather than having two completely separate templates, we can use subtemplates to specify only the part of the template that has changed. If we compare and, we can see the only differences are within the ContentContainer div. Copy the contents of the ContentContainer div from tutorial/templates/ to a new file tutorial/templates/Layout/, and do the same from tutorial/templates/ to tutorial/templates/Layout/


We can then delete tutorial/templates/, as it is no longer needed. Replace the code we just copied out of tutorial/templates/ with $Layout, so it looks like this:

I say: How does it know to look into ..layout/ folder?.  Anyway, crazy stuff.  Oh look they already answered my question:

SilverStripe first searches for a template in the tutorial/templates folder. Since there is no, it will use the for both Page and HomePage page types. When it comes across the $Layout tag, it will then descend into the tutorial/templates/Layout folder, and will use for the Page page type, and for the HomePage page type.

And gave a nice image of it here: