django-friendly-tag-loader
Use templatetag libraries in Django templates to optionally support features.
This app provides three template tags {% friendly_load %}, {% if_has_tag %} and {% ifnot_has_tag %}.
Used together you can built templates that have optional support for certain template tags. You can use them if they are available and do something else if they are not.
Installation
Add friendlytagloader to INSTALLED_APPS
Usage
{% load friendly_loader %} in your template
Load some optional taglib {% friendly_load comments %}
Or load a specific tag {% friendly_load cycle from future %}
Conditionally use its tag:
{% if_has_tag render_comment_list %}
{% render_comment_list for obj %}
{% else %}
Comment support is not available
{% endif_has_tag %}
{% friendly_load %} takes multiple arguments, so loading multiple optional template tag libraries at once is supported:
{% friendly_load comments webdesign website_tags %}
{% if_has_tag %} and {% ifnot_has_tag %} can also handle multiple arguments.
In the case of if_has_tag this means that all given tags should be available, so this will render nothing even though now is a built-in tag:
{% if_has_tag now nonexisting_tag %}
{% now 'Y' %}
{% endif_has_tag %}
The ifnot_has_tag condition will trigger if any of the given tags is unavailable. For example this will render the message since, even though now is a built-in tag, nonexisting_tag is not available:
{% ifnot_has_tag now nonexisting_tag %}
Some tags are unavailable.
{% endifnot_has_tag %}
Credits
Original Author: Jaap Roes
Current Maintainer: Adam Taylor
Metadata
Release files for django-friendly-tag-loader 1.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_friendly_tag_loader-1.3.2.tar.gz | 10.4 kB | Without provenance | Details for django_friendly_tag_loader-1.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_friendly_tag_loader-1.3.2-py3-none-any.whl | Python 3 | none | any | Details for django_friendly_tag_loader-1.3.2-py3-none-any.whl |
Total release size: 15.8 kB
Release files / django_friendly_tag_loader-1.3.2.tar.gz
| Download URL | django_friendly_tag_loader-1.3.2.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36de040ba8c408b0e6d1fa57ff89b4af1aa9806aaf1cfbaa673861737fb40f78
|
|
BLAKE2b-256 checksum How to use checksums |
d8ee118e1de58f26fe4826b44fcd56ac9f58f0f8a15864c165fe96ef6a4f8ee5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.6
|
Release files / django_friendly_tag_loader-1.3.2-py3-none-any.whl
| Download URL | django_friendly_tag_loader-1.3.2-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c84ad4703b7d989388ee128da5cbe901dbc39eb14174a5a08a888be38392aa5
|
|
BLAKE2b-256 checksum How to use checksums |
30d74749854026d24d29334697e6bf9610af4d5a1aca5dfea649c84f15ad57b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.6
|
Security for django-friendly-tag-loader 1.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.