﻿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
34468	`Cycle` tag do not work with variables defined in `with`-tag.	Алексей Поклонский	nobody	"Here is the example:

{{{
{# context is simple dict with one key {A=[""1"", ""2"", ""3""]} #}

{% with example_defined_variable=""123"" %}

{% for item in A %}

Current item: {{ item }}

Current cycle item: {% cycle example_defined_variable %}

{% endfor %}

Visible page.

{% endwith %}
}}}

As you can see I render this template using django 4.0.1 and context containing 1 key ""**A**"" with the value of **[""1"", ""2"", ""3""]** (that is the list of strings).
Then I try to print the items of the list along with predefined value (see **with**-tag).
The result must be like:

{{{
Current item: 1 
Current cycle item: 123 
Current item: 2 
Current cycle item: 123 
Current item: 3 
Current cycle item: 123 
Visible page.
}}}

But instead Im getting:

No named cycles in template. 'example_defined_variable' is not defined

That means that cycle-tag do not recognize **example_defined_variable** as defined variable, BUT
on the [https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#cycle documentation] page there is the note that you CAN use defined variables in cycle-tag.
"	Bug	closed	Template system	4.0	Normal	invalid	cycle, with, templates	jispar@…	Unreviewed	0	0	0	0	0	0
