Opened 7 years ago

Closed 7 years ago

#10823 closed (duplicate)

Implement using variable values within template tags

Reported by: anonymous Owned by: nobody
Component: Template system Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Currently writing template code like this:

<a href="{% url {{currentPageName}} nextPageOffset %}">Next page</a>

results in syntax error.

Technically I see no obstacle to disallow evaluating such expressions, please implement it.

Change History (2)

comment:1 Changed 7 years ago by anonymous

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

After thinking it over, the problem is actually with the URL tag.
It interprets unquoted text as value not variable reference, unlike other tags.

The proposed syntax is just a workaround for problem within the URL tag.

comment:2 Changed 7 years ago by Alex Gaynor

Resolution: duplicate
Status: newclosed

There was another ticket asking for variables for the viewname in the {% url %}, it was wontfixed.

Note: See TracTickets for help on using tickets.
Back to Top