﻿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
36130	Add inclusion support for simple block tags	Jake Howard		"Django's template system allows creating tags which include other templates:

{{{#!python
@register.inclusion_tag(""results.html"")
def show_results(poll):
    choices = poll.choice_set.all()
    return {""choices"": choices}
}}}

However, with the addition of `simple_block_tag` in #35535, it would be nice to combine the 2 into a `inclusion_block_tag`. This creates a form of reusable component for Django template, combining context transformation, rendering and internal content. There are a number of libraries in the Django ecosystem which achieve this (eg `slippers`), so there's clearly an appetite for this functionality.

{{{#!python
@register.inclusion_block_tag(""results.html"")
def show_results(content, poll):
    choices = poll.choice_set.all()
    return {""content"": content, ""choices"": choices}
}}}

{{{#!django
{% show_results poll %}
  This content gets captured too
{% endmysimpletag %}
}}}

The API matches the existing `inclusion_tag`, but with an additional required `content` argument containing the (rendered) template content."	New feature	closed	Template system		Normal	wontfix		Jake Howard Sébastien Corbin	Unreviewed	0	0	0	0	0	0
