title: Apache Velocity "main template"?
body: <p>I'm very new to Apache Velocity, and I'm having a little trouble figuring out the optimal way to structure my templates. In most of the guides I have seen the pages have been built like this: </p>
  
  <pre><code>#parse("header.vm")
  &lt;body&gt;
      ...
  &lt;/body&gt;
  #parse("footer.vm")
  </code></pre>
  
  <p>I have also seen someone come close to a "main" template with this approach:</p>
  
  <pre><code>&lt;head&gt;
      ...
  &lt;/head&gt;
  &lt;body&gt;
  #if($activeTab=="home")
      #parse("home.vm")
  #elseif($activeTab=="aboutus")
      #parse("aboutus.vm")
  ...and so on.
  &lt;/body&gt;
  </code></pre>
  
  <p>Which seems a little silly, but I guess it works.</p>
  
  <p>I've used Twirl a lot, so I might be spoiled, but I'd like to inject a template into another, essentially ending up with a main template like this:</p>
  
  <pre><code>&lt;head&gt;
      ...
  &lt;/head&gt;
  &lt;body&gt;
      $content
  &lt;/body&gt;
  </code></pre>
  
  <p>And then writing every other template as: </p>
  
  <pre><code>#parse(main){ 
      TEMPLATE CONTENT 
  }
  </code></pre>
  
  <p>Is this possible in Velocity? If yes, is it bad practice, and if so why? 
  Thanks.  </p>