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. |
False, 0, True, 1 |
False |
The default value for the show_key-option can be overriden with the TEXTBLOCKS_SHOWKEY = True-setting.
Release files for django-textblocks 0.8.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-textblocks-0.8.3.tar.gz | 7.1 kB | Details |
Release files / django-textblocks-0.8.3.tar.gz
| Download URL | django-textblocks-0.8.3.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4e75c0fd6af6fdb0b5c95dbdf10c6f6dd8a4f002fe4f55838857b9ed1346dc6
|
|
BLAKE2b-256 checksum How to use checksums |
5018768da79fdd3de8c2c876bef4c63f107698cb004a8d02ba18f286dcebbb8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|