Blocks

Blocks are used to define spaces that can be filled by child templates.  For example a template might look like this:

<html>
<body>
{% block content %}{% endblock content %}
</body>
</html>

Now a child can be created that extends this template. It can define a content block that will fill in the block above.

It is also possible to set a default, in case a child doesn't fill the block in:

<html>
<body>
{% block content %}
<h1>{{ this.title }}</h1>
{% endblock content %}
</body>
</html>

Now, if the child doesn't define a 'content' block, a default will be displayed. It is also possible to nest blocks:

<html>
<body>
{% block content %}
  <h1>{% block title %}{{ this.title }}{% endblock title %}</h1>
{% endblock content %}
</body>
</html>

Now a child template can define 'content' and override the whole thing, or 'title' and just replace the title area. It is also possible for the child to use {% parent %} to use the default in its defintion.