'jinja.extension': 'tmpl'
})
+Note that you have to use a trailing slash to load templates if you want to
+specify the extension. Otherwise use the dotted notation:
+
+.. sourcecode:: python
+
+ render_template('/index.html')
+ render_template('index')
+
+ render_template('/modules/userlist.html')
+ render_template('modules.userlist')
+
TurboGears
----------
return self.environment.from_string(template_string)
# Translate TG dot notation to normal / template path
- if '/' not in templatename and '.' in templatename:
- templatename = '/' + templatename.replace('.', '/') + '.' + self.extension
+ if templatename.startswith('/'):
+ templatename = templatename[1:]
+ else:
+ templatename = templatename.replace('.', '/') + '.' + self.extension
return self.environment.get_template(templatename)