Django app allowing for configurable targetting of template inclusion tags.
Project description
Django Gizmo
============
**Django app allowing for configurable targetting of template inclusion tags.**
Installation
------------
#. Add **gizmo** to your **INSTALLED APPS** setting.
#. Add ROOT_GIZMOCONF value to your projects settings file::
ROOT_GIZMOCONF = 'project.gizmos'
#. Create your gizmos config file in the form::
gizmos = (
('<loader name>', '<tag name>', '<slot name>', [['<url_name'>, ]]),
)
With:
* <loader name> being the name you would normally pass to Django's load tag, i.e. **myapp_inclusion_tags** for **{% load myapp_icnlusion_tags %}**.
* <tag name> being the name of the tag you want to include, i.e. **advert** for **{% advert %}**
* <slot name> being the name of the slot you want the tag to show up in, i.e. **home**.
* <url_name> *optional* being the names of the urls you want the tag to show up in, i.e. **home**.
Usage
-----
Gizmos are stock standard Django inclusion tags. The only diffirence is that instead of specifying tags within a template you specify tags from a distance by using a gizmo conf file in conjunction with the gizmos tag.
For example, lets say we have an **advert** tag specified in **myapp**'s inclusion tags which we only want to call in gizmo slots named **advert** for the url named **home**:
#. Create your tags as normal.
#. Create your gizmos config file in the form::
gizmos = (
('myapp_inclusion_tag', 'advert', 'advert', ['home', ]),
)
#. In your template for the home view load the gizmo inclusion tags and include a gizmos tag with a slot name of advert::
{% load gizmo_inclusion_tags %}
...some html...
{% gizmos 'home_advert' %}
...some more html...
============
**Django app allowing for configurable targetting of template inclusion tags.**
Installation
------------
#. Add **gizmo** to your **INSTALLED APPS** setting.
#. Add ROOT_GIZMOCONF value to your projects settings file::
ROOT_GIZMOCONF = 'project.gizmos'
#. Create your gizmos config file in the form::
gizmos = (
('<loader name>', '<tag name>', '<slot name>', [['<url_name'>, ]]),
)
With:
* <loader name> being the name you would normally pass to Django's load tag, i.e. **myapp_inclusion_tags** for **{% load myapp_icnlusion_tags %}**.
* <tag name> being the name of the tag you want to include, i.e. **advert** for **{% advert %}**
* <slot name> being the name of the slot you want the tag to show up in, i.e. **home**.
* <url_name> *optional* being the names of the urls you want the tag to show up in, i.e. **home**.
Usage
-----
Gizmos are stock standard Django inclusion tags. The only diffirence is that instead of specifying tags within a template you specify tags from a distance by using a gizmo conf file in conjunction with the gizmos tag.
For example, lets say we have an **advert** tag specified in **myapp**'s inclusion tags which we only want to call in gizmo slots named **advert** for the url named **home**:
#. Create your tags as normal.
#. Create your gizmos config file in the form::
gizmos = (
('myapp_inclusion_tag', 'advert', 'advert', ['home', ]),
)
#. In your template for the home view load the gizmo inclusion tags and include a gizmos tag with a slot name of advert::
{% load gizmo_inclusion_tags %}
...some html...
{% gizmos 'home_advert' %}
...some more html...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-gizmo-0.0.1.tar.gz
(5.6 kB
view details)
Built Distribution
django_gizmo-0.0.1-py2.6.egg
(12.2 kB
view details)
File details
Details for the file django-gizmo-0.0.1.tar.gz
.
File metadata
- Download URL: django-gizmo-0.0.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac32a6ab86bcc79a0f7884a564d56306ff72440466e323fc9367bbd744b04e4b |
|
MD5 | 1c4e8af3bf37923261abad84c5ea3bb7 |
|
BLAKE2b-256 | b49b9d4d4a57a3a6fa6bf9e0084202b1ebaf1400f2f3605af4e96e7c447b788b |
Provenance
File details
Details for the file django_gizmo-0.0.1-py2.6.egg
.
File metadata
- Download URL: django_gizmo-0.0.1-py2.6.egg
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2118615786b205dbd5b0734c2c57cf23f7e40d938fac642af827b99f23d740b0 |
|
MD5 | de2fd9b41bc6ec16d636a6751661db8c |
|
BLAKE2b-256 | 806a48d7dc258bf1862ce6dda51a3481aff0e311b595c976c55237ea0b9d67cc |