Master Layout

Each template on the Open Cph starter site is based on a Razor Layout page named "Master Layout".

You can edit the Master Layout from the "Layout" perspective: Page Templates / Shared Code / MasterLayout.cshtml.

On the website, it is located at ~/App_Data/PageTemplates/MasterLayout.cshtml.

The Master Layout includes all the <head/>-related elements, such as references to stylesheets and javascripts in use or common meta tags, required in all the templates.

It also includes some content common to all the templates. This content is normally inserted with page template features.

When changing the page layout, appearances or content, take into account these shared content insertions at the Master layout level along with those at the template level.

Features used in <head/>

The common elements for the <head/> part are inserted via this template feature:

Features used in <body/>

The following are the page template features used in the Master Layout:

It is here where the linked website title ('brand' link) is inserted that appears on the left side of the top bar of a page and opens the home page of the website when clicked.

<a class="brand" href="/">@websiteTitle</a>

RenderBody method

As the Master Layout works as a Razor Layout page here, it uses the standard RenderBody() method that indicates where a template should fill in its content on a page.