Opened 13 years ago

Closed 13 years ago

#1254 closed enhancement (invalid)

%ssi tag only includes hard-coded filenames

Reported by: ivo.munoz@… Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The %ssi tag (this could be extended to other inclusion tags as well) only allows hard-coded filenames limiting the usability of the tag.

Typical use case: I would like to include some info I have in files based on e.g. article number like.

{%ssi {{basepath}}/text/um-{{article_id}}.txt %} which does not work.

This is currently not supported. Why?

Change History (1)

comment:1 Changed 13 years ago by hugo

Resolution: invalid
Status: newclosed

The ssi tag is defined to just include a predefined named template. For other situations you would use the {% include "foo/bar/baz" %} tag - that invocation would search your template loaders for a foo/bar/baz.html template and load that.

You still can't have partially variable names - to do that, you would have to construct the template name in your view function and pass that via the context into the template.

Please ask usage questions like this in either the django-users list or the IRC channel, as the ticket system is better left for actual defects or enhancement requests.

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