For beginners and masters alike, the Sitemason Boilerplate template is a great place to start your project. We are constantly improving Sitemason, and we'll make additions to the boilerplate to take advantage of new Sitemason features as they come online. Even if you're a pro and feel real comfortable with Sitemason, it's always a great place to look and see if any major changes or updates have been made that could benefit your project.
If much of this looks familiar, it's not a coincidence. Most of it is influenced by, if not pulled directly from, the fantastic work being done by Paul Irish and crew at www.html5boilerplate.com. Tim Moses at Sitemason has added a significant number of improvements to the Sitemason PHP Library to make implementing much of the boilerplate a breeze, in true Sitemason fashion. You can read all about those additions on the Sitemason Developer Group.
Download the Full Version which includes the html5boilerplate.com full line-by-line documentation of the Sitemason PHP template (as seen below) or just the nuts & bolts Minimum Version.
![]() |
![]() |
<?php
require_once('/web/shared/php/1.0/sitemason.inc');
# Load the Main Content XML
# http://developer.sitemason.com/library/methods/getxml.149741
$content = new Content($content_xml);
$content_xml = $content->getXML();
# Load Optional Side Content XML
# http://developer.sitemason.com/library/methods/sidecontent.149750
# $side = new SideContent('http://www.side-content-url.com?toolxml');
# $side_xml = $side->getXML();
# $site_url variable helpful for including assets when redeveloping or working on site without DNS pointed to Sitemason
$site_url = 'http://www.site-url.com';
# prepend the $secure_url variable when including asset files so they are transferred securely when at secure.sitemason.com
$secure_url = $content_xml->secure_image_url;
# use the $layout variable for includes or layout specific functions
if ($content_xml->current_nav->id == 'xxxxxx') {
$layout = 'home';
} else {
$layout = 'interior';
}
?>
<!-- http://developer.sitemason.com/library/methods/printinithtml.149561 -->
<?php $content->printInitHTML('HTML 5'); ?>
<head>
<meta charset="utf-8">
<!-- Use the .htaccess and remove these lines to avoid edge case issues.
More info: h5bp.com/i/378 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- http://developer.sitemason.com/library/methods/printpagehead.149569 -->
<?php $content->printPageHead(); ?>
<!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
<link rel="stylesheet" href="<?php echo $secure_url; ?>/sm_template/css/style.css">
<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
<!-- All JavaScript at the bottom, except this Modernizr build.
Modernizr enables HTML5 elements & feature detects for optimal performance.
Create your own custom Modernizr build: www.modernizr.com/download/ -->
<script src="<?php echo $secure_url; ?>/sm_template/js/libs/modernizr-2.5.3.min.js"></script>
</head>
<!-- http://developer.sitemason.com/library/methods/printbodytag.149554 -->
<?php $content->printBodyTag(); ?>
<!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
chromium.org/developers/how-tos/chrome-frame-getting-started -->
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header>
<!-- http://developer.sitemason.com/library/methods/printnavaslist.149568 -->
<?php $content->printNavAsList(); ?>
</header>
<div role="main">
<!-- http://developer.sitemason.com/library/methods/printcontent.149744 -->
<?php $content->printContent(); ?>
</div>
<footer>
<!-- In addition to using the library, you can always parse the XML directly
http://developer.sitemason.com/parsing_xml_php#Retrieving_a_Single_Value_from_XML -->
<?php echo $content_xml->footer; ?>
</footer>
<!-- Thanks for the props! -->
<div id="sitemason"><span>Built on </span><a href="http://www.sitemason.com">SITEMASON</a></div>
<!-- JavaScript at the bottom for fast page loading -->
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<?php echo $secure_url; ?>/sm_template/js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<!-- scripts concatenated and minified via build script -->
<script src="<?php echo $secure_url; ?>/sm_template/js/plugins.js"></script>
<script src="<?php echo $secure_url; ?>/sm_template/js/script.js"></script>
<!-- end scripts -->
<!-- http://developer.sitemason.com/library/methods/printbodylast.149552 -->
<?php $content->printBodyLast(); ?>
</body>
</html>
4/25/2012 v0.4
7/29/2011 v0.3
2/21/2011 v0.22
9/23/2010 v0.21
9/20/2010 v0.2
9/7/2010 v0.11
9/3/2010 v0.1
Launched! When we start a new project over at Sitemason, we usually begin with a simple boilerplate template. Emulating the great work at html5boilerplate.com, we decided to give ours a shot of steroids, document & publish to the website for the benefit of all Sitemason developers. Enjoy, and send all comments/questions to developer-group@sitemason.com.