Skip to main content

Simple app for managing small blocks of text/html.

Project description

https://travis-ci.org/fabiangermann/django-textblocks.svg?branch=master

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.

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

django-textblocks-0.4.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file django-textblocks-0.4.tar.gz.

File metadata

File hashes

Hashes for django-textblocks-0.4.tar.gz
Algorithm Hash digest
SHA256 fd8053138557f2e0f0e9ae9df30fcb9f58f72c1bc6b9e28ec7736e11086afd59
MD5 6241ac8a4129a0562f05c23d1aa0e152
BLAKE2b-256 17f7b563e3787346311bbe6204ab3ea16d77b309d698818856928a8b18669538

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page