django-renderit 1.2 documentation
Contents
{% renderit [object] [arg] [arg] ... [with] [group=S] [prefix=S] [concat=S] [context=True|False] [site=True|False] [as] [varname] %}
Simplest Form:
{% renderit request.user %}
Multiple Arguments:
{% renderit request.user auth custom %}
With Prefix
{% renderit request.user auth custom with prefix=header %}
Change concatination string to be __ (double under score)
{% renderit request.user auth custom with prefix=header concat="__" %}
Only required argument, can be any python object.
Anything specified after [object] and before [with] will be treated as extra concatination strings. These can also be context variables.
Note
If an object is resolved and contains a space, the argument will be
slugified, using django.template.defaultfilters.slugify
Required only if [group], [prefix] or [concat] is used.
This value is used to better structure the template location. A folder with the supplied value will be preprened to template path.
Example
{% renderit auth.user with group='users' %}
Template path built:
'/renderit/users/auth_user.html'
Prefixes the template with supplied value.
Example
{% renderit auth.user with prefix='users' %}
Template path built:
'/renderit/users_auth_user.html'
Change the default concatination string when building templates, default is _ (underscore)
Example
{% renderit auth.user with concat="__" %}
Template path built:
'/renderit/auth__users.html'
Note
The default concatination string can be changed using CONCATINATION_STRING
If True (default) the template context will be passed into the template.
If True the site will be used to add additional possible templates on a per site basis
Example
{% renderit auth.user with site=True %}
Only required if a return variable is used.
Store the rendered template into a context varaible.
Example
{% renderit auth.user as auth_var %}
{{ auth_var }}