Master Page

What's a master page?

There are some sections on the space website which are repeated in every section of it. For example, the navigation menu and the content of the footer, is very similar in every section. Also, there are files which need to be included in every page, such as the CSS and JavaScript files required for the site to look and function correctly. To avoid having to include all this HTML markup in every single page, Spaces uses a master page. This page contains all the common elements to all the pages in the site.


Click on the image to make it larger

By default, there is only one master page in your account, named "master.master". This page contains all the common elements and gives the general structure to the space website.


How does it work?

A master is a normal HTML page, it can use any of the DotLiquid code as any other page, but it can also define sections or placeholders (known as blocks in DotLiquid) where other pages using this master page can insert content.


Click on the image to make it larger

The light blue sections represent the content defined in the master page. This content is rendered in every page. The master page also defined a placeholder (block) where child pages can inject content.

The light orange sections respresent a child page using the placeholders defined in a master page. The child page injects content into the placeholder defined in the master page.

When defining a block in a master page, you can provide some content inside that block. This content will be only rendered if the child page using the master page does not provide content for that block. Effectively, by doing this you are providing a default content for the place holder, but any child page using the master page, can override this content with its own.



Source: XML ! RSS