Simple app for managing small blocks of text/html.
Project description
Installation
Add textblocks and optionally modeltranslation to INSTALLED_APPS
Add an entry for textblocks to your MIGRATION_MODULES (textblocks cannot ship its own migrations because the exact schema depends on your LANGUAGES setting) and create an empty Python module (folder with an empty __init__.py file).
Run ./manage.py makemigrations textblocks and ./manage.py migrate
Usage
Load templatetags {% load textblock_tags %}
Add textblock tags with unique identifiers:
{% textblock "introduction" %}
Text blocks with identifiers that do not exist in the database yet will automatically be created.
You can optionally provide the following keyword arguments:
Argument |
Description |
Possible Values |
Default |
---|---|---|---|
type |
Sets the content type. |
text/plain, text/html |
text/plain |
show_key |
If set to true, the template will render the textblock key for textblocks without a value. |
0, 1 |
0 |
The default value for the show-key-option can be overriden with the TEXTBLOCKS_SHOWKEY-setting.
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
File details
Details for the file django-textblocks-0.3.tar.gz
.
File metadata
- Download URL: django-textblocks-0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef835373be80be3732911dd9e7634c4d8c1725a94e15801d918c17e0bacd4590 |
|
MD5 | a1845a07e7390ac6133624ebbc7a538f |
|
BLAKE2b-256 | 55900a796da3527b691866301947a1edbeb5e0705f550795f7cdfdf54d6cd18e |