Page master template

From The Smartest Wiki
Jump to: navigation, search

A page master template is a template that contains the essential elements of a page, that do not normally change from one page to another. This usually includes the HTML<head> and any metadata placed there, the opening and closing <body> tags, as well as aspects of a page such as global navigation, masthead, search box, footer, copyright notice, and analytics tags.


A typical (but bare) page master template might look like this:

<!DOCTYPE html>


     <meta charset="UTF-8" />
     <meta name="keywords" content="<?sm:$>" />
     <meta name="description" content="<?sm:$>" />
     <?sm:stylesheet file="global_style.css":?><!--This stylesheet will always be included on the page-->
     <?sm:placeholder name="page_specific_javascript" editbutton="false":?>
     <?sm:placeholder name="page_specific_stylesheet":?><!--The stylesheet included here can be different from page to page-->

    <?sm:container name="page_layout":?><!--A container template will be included here-->


Note the container tag, to allow web pages using this page master template to have different layouts. Most containers probably have some effect on page layout, but on each website one container can be nominated as the website's primary container, meaning that its role in determining the overall layout of pages can be stored in the system, and the container can be presented to the user as page layout.