Simple app for managing small blocks of text/html.
Project description
==========
Textblocks
==========
.. image:: https://travis-ci.org/fabiangermann/django-textblocks.svg?branch=master
:target: https://travis-ci.org/fabiangermann/django-textblocks
Installation
============
1. Add ``textblocks`` and optionally ``modeltranslation`` to
``INSTALLED_APPS``
2. 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).
3. Run ``./manage.py makemigrations textblocks`` and ``./manage.py migrate``
Usage
=====
1. Load templatetags ``{% load textblock_tags %}``
2. 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.
Textblocks
==========
.. image:: https://travis-ci.org/fabiangermann/django-textblocks.svg?branch=master
:target: https://travis-ci.org/fabiangermann/django-textblocks
Installation
============
1. Add ``textblocks`` and optionally ``modeltranslation`` to
``INSTALLED_APPS``
2. 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).
3. Run ``./manage.py makemigrations textblocks`` and ``./manage.py migrate``
Usage
=====
1. Load templatetags ``{% load textblock_tags %}``
2. 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.
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-textblocks-0.7.tar.gz
(6.4 kB
view details)
File details
Details for the file django-textblocks-0.7.tar.gz
.
File metadata
- Download URL: django-textblocks-0.7.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b565bbd1cf842f0f696079fed56374b40ebccfeae2befc64b587f4f6f6bcca |
|
MD5 | cfdd3ada2381df9e99b242cb458a2c3f |
|
BLAKE2b-256 | 4b99726d090e4cba060fd4736bac56dce0d7b2e28f8cc95ca13db5e92e6ffd32 |