﻿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
25742	"""default_if_not_set"" template filter"	Ramez Issac	nobody	"Working with template, sometimes i want to make a snippet to be included and control it via context variables.

{{{
{% include 'snippet.html' my_var=False %}
}}}

in the snippet.html
{{{
{# want my_var to default to True #}
<div> 
{% if my_var %}
    {# Do so and so #}
{% endif %}
</div>
}}}
Problem is that we can't set a default value for those variables

my_var|`default` filter will evaluate the variable, if it's False (which might be the desired), the tag will change it
On the other hand, `default_if_none` filter , will have no effect as unassigned context variables are evaluated as empty string (not None)

Proposal:
introduce default_if_not_set filter.

I can do it if accepted.
Regards"	New feature	closed	Template system	1.8	Normal	wontfix	template default filter	ramezashraf@…	Unreviewed	0	0	0	0	0	0
