An open API service indexing awesome lists of open source software.

https://github.com/cododel/django_template_tags

Custom template tags for django.
https://github.com/cododel/django_template_tags

Last synced: 5 months ago
JSON representation

Custom template tags for django.

Awesome Lists containing this project

README

          

# django_template_tags
Custom template tags for django.

> Adds tags such, as: "multiply", "range", "or"
> Before use needs load {% load common_tags %}

# For install:
Add "templateteags" dit to your application and register "common_tags" in the settings to "TEMPLATES" > "libraries":

TEMPLATES = [
{
'BACKEND': '...',
'DIRS': [...],
'APP_DIRS': ...,
'OPTIONS': {
...
'libraries': {
'common_tags': 'appname.templatetags.common_tags',
}
},
},
]

## Multiply
Repeat content by number of times:

{% multiply %}
[Content]
{% endmultiply %}

## Range
"range" it is generated list from range and passed to template tag "cycle" and might be used like "cycle" tag with number list, or in multiply like cycle number generator.
Examples syntax:

{% range %}
{% range %}
{% range %}
{% range as %}
{% range as [silent] %}