﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11832	include tag with optional block argument (selective include feature)	Marco Paolini	nobody	"Sometimes, for clarity, an included template contains code for different parts of the parent.

This patch allows an extra {{{block}}} optional argument to the include tag. If specified, only that particular block of the included template will be included.

an example:

base.html:
{{{
<head>
{% include ""table-include"" ""jscript"" %}
</head> 
<body>
<table>
{% include ""table-include"" ""header"" %}
{% for row in rows %}
 {% include ""table-include"" ""rowdata"" %}
{% endfor %}
</table>
</body>
}}}

table-include.html:
{{{
{% block jscript %}
<script> <!- --> </script>
{% endblock %}
{% block header %}
<tr><th>heading</th></tr>
{% endblock %}
{% block rowdata %}
<tr><td>{{row.data}}</td></tr>
{% endblock %}
}}}

Without this patch you would need three different included tepmlates like: table-include-js.html, table-include-header.html and table-include-rowdata.html making the whole thing less maintainable

if the block in arg is not found maybe we should raise a {{{TemplateSyntaxError}}} (or maybe not)

patch is just a proof of concept. Tests included

comments welcome
"		closed	Template system	1.1		wontfix	feature		Unreviewed	1	0	0	0	0	0
