Skip to content

Instantly share code, notes, and snippets.

@nathanborror
Created October 29, 2009 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanborror/221803 to your computer and use it in GitHub Desktop.
Save nathanborror/221803 to your computer and use it in GitHub Desktop.
# base.html
{% block content_wrapper %}
<div class="content">
{% block content %}{% endblock %}
</div>
{% endblock %}
# object_detail.html
{% extends "base.html" %}
{% block content_wrapper %}{% endblock %}
Using the capture method:
# base.html
{% capture content %}
{% block content %}{% endblock %}
{% endcapture %}
{% if content %}
<div class="content">{{ content }}</div>
{% endif %}
# object_detail.html
No action is needed because base template handles the logic to clear out the content DIV.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment