- Add
textblocks
and optionallymodeltranslation
toINSTALLED_APPS
- Add an entry for
textblocks
to yourMIGRATION_MODULES
(textblocks cannot ship its own migrations because the exact schema depends on yourLANGUAGES
setting) and create an empty Python module (folder with an empty__init__.py
file). - Run
./manage.py makemigrations textblocks
and./manage.py migrate
- 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 |
---|---|---|---|
|
|
|
|
|
|
|
|
The default value for the show_key
-option can be overriden with the TEXTBLOCKS_SHOWKEY = True
-setting.