From a0c354ee4ed02bb3f958dfb029d29b76e6637952 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 12 Feb 2007 00:22:22 +0000 Subject: Fixed #3351 -- Added optional naming of the block in "endblock" tags to ensure correct nesting. Thanks for the patch, SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4489 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/templates.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/templates.txt b/docs/templates.txt index a3d60c5400..9b3825f9f7 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -253,6 +253,11 @@ Here are some tips for working with inheritance: if you want to add to the contents of a parent block instead of completely overriding it. + * You can optionally name your ``{{ endblock }}`` tag with the same name + you gave the ``{{ block }}`` tag (for example, ``{{ endblock content }}``). + In larger templates this helps you see which ``{{ block }}`` tags are + being closed. + Finally, note that you can't define multiple ``{% block %}`` tags with the same name in the same template. This limitation exists because a block tag works in "both" directions. That is, a block tag doesn't just provide a hole to fill -- -- cgit v1.3