Created
October 29, 2009 20:44
-
-
Save nathanborror/221803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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