﻿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
3171	[patch] Support for dynamic values in inclusion_tag template name	nick@…	Adrian Holovaty	"The inclusion_tag doesn't support dynamic values in the template name, which I found I needed in several places when creating custom template tags. Initially I just wrote my own helper function but it was so similar to inclusion_tag I thought I would post a patch here in case it was useful.

A simple example of how I'm using this for a generic ""filtered"" list (similar to the admin ChangeList) with different templates for different lists:

{{{
def filters(fl):
    return {'fl': fl}
filters = register.inclusion_tag('%s/filters.html', inclusion_params=('fl.template_path',))(filters)
}}}

Each item in inclusion_params is resolved and then all are passed as a tuple into the template_name string to generate the final template filename. Note that the ""fl"" item in inclusion_params variable refers to the ""fl"" parameter to the filters function, not to some arbitrary ""fl"" variables inside the template context."	enhancement	closed	Template system	dev	normal	invalid			Unreviewed	1	0	0	0	0	0
