The 'include' tag can accept relative paths. The 'ssi' tag, however,
only accepts absolute paths.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
On 6/1/06, Wei Litao <wlt...@gmail.com> wrote:
> I have a template which reside in 'myapp/tmpl1.html'. In this template I
> want to 'include' another template which reside in 'myapp/tmpl2.html'. But I
> don't want to use the syntax as '{% include "myapp/tmpl2.html" %}' .
> Instead, i want simply use something like '{% include " tmpl2.html" %}' ,
> because tmpl2.html lived in the same folder as tmpl1.html. Is it possible to
> do that?
The 'include' tag can accept relative paths. The 'ssi' tag, however,
only accepts absolute paths.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
{% include %} searches templates not by directory structure. It follows
Django's mechanism of template loaders
(http://www.djangoproject.com/documentation/templates_python/#loader-types)
that can search in designated template directories, in application's
internal template directories in egg files, in database. For example
you can have two apps with template directories:
app1/
templates/
somedir/
base1.html
app2/
templates/
somedir/
base2.html
And those templates will be known by names 'somedir/base1.html',
'somedir/base2.html' though they are not in the same directory physically.
I'd recommend to think about template structure not as some physical
files in directories but as some virtual tree structure that doesn't
have a concept of "same" directory and always requires you to use
explicit full template names.