example: overlay chain positive space

Let’s extend the simple example to add an intermediate template, so we
therefore have an overlay chain consisting of 3 templates, namely
overlay_chain_pos.html over overlay_mid.html
over the unmodified base.html (from simple example).

The templates


        -ve space (overlay_mid.html)
$begin{footer}<span>overlay_mid footer</span>$end{footer}
        -ve space (overlay_mid.html)
  • an intermediate positive overlay on base.html
  • the -ve space from base.html is imposed
  • overrides one +ve block, #footer


<head><title>template = ${title}</title></head>
<body>      <span> -ve space (overlay_chain_pos.html) </span>
  $begin{content} overlay_chain_pos ${parametrized} content $end{content}
  <div class="header">$evoque{#header}</div>
  <div class="content">$evoque{#content}</div>
  <div class="footer">$evoque{#footer}</div>
  • overrides the positive space of overlay_mid.html, redefining #content
  • when evoque’d directly, this template is rendered with:
    • the -ve space from below
    • own #content
    • the #header and #footer from below


Rendering the overlay:

name = "overlay_chain_pos.html"
domain.get_template(name).evoque(title=name, parametrized="HAPPY")

Will give the following output (note negative space used is that from base.html):

<head><title>template = overlay_chain_pos.html</title></head>
<body>          <span> -ve space (base.html) </span>
  <table class="layout">
    <tr><td> +ve space: base header </td></tr>
    <tr><td> overlay_chain_pos HAPPY content </td></tr>
    <tr><td><span>overlay_mid footer</span></td></tr>