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.
- Host: GitHub
- URL: https://github.com/cododel/django_template_tags
- Owner: cododel
- Created: 2020-12-23T22:52:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-11T03:57:07.000Z (over 4 years ago)
- Last Synced: 2025-03-06T18:50:19.028Z (about 1 year ago)
- Language: Python
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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] %}