Lift supports surrounding a given section of a page with a template from another file. This allows you to have master page templates or even section templates that are accessed by many different pages.

<lift:surround with="default" at="content">
  This is a simple page surrounded by the default template.
</lift:surround>

Using the <lift:surround> tag, you can surround the body with the contents of another template. The "with" attribute designates the name of the template. By convension, templates are stored in the /templates-hidden directory. Lift will not serve direct HTTP request from any directory that contains "-hidden". The "at" attribute specifies where the content should be placed in the loaded template. Lift will look for a <lift:bind name="..."/> tag in the target template and insert the body of the surround tag at the bind point.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift='http://liftweb.net'>
  <head>
    <title>Lift Web Framework: <lift:Menu.title /></title>
    
    <lift:CSS.blueprint />
    <lift:CSS.fancyType />
    <script id="jquery" src="/classpath/jquery.js" type="text/javascript"/>
    <script id="json" src="/classpath/json.js" type="text/javascript"/>
  </head>
  <body>
    <div class="menu">
      <lift:menu.builder/>
    </div>
    <div class="messages">
      <lift:Msgs />
    </div>
    
    <div class="contents">
      <lift:bind name="content" />
    </div>
  </body>
</html>