A mezzanine flavored fork of [django-flatblocks] 1. The goal of this project is to be able to easily create custom blocks of text/HTML in the template, and can be editable via admin.
- Add "mezzanine_blocks" to INSTALLED_APPS:
INSTALLED_APPS = (
"...",
"mezzanine_blocks",
)
- Add "Blocks" menu item to admin menu (Optional):
ADMIN_MENU_ORDER = (
("Content", (
"pages.Page",
"mezzanine_blocks.Block",
"blog.BlogPost",
"blog.BlogCategory",
"generic.ThreadedComment",
("Media Library", "fb_browse"),
)
),
)
- Run python manage.py createdb or python manage.py syncdb && python manage.py migrate.
-
Include block_tags in the template:
{% load ... block_tags %}
-
Insert block anywhere in the template:
{% flatblock "My Awesome Block" %}
{% richflatblock "My Awesome HTML Block" %}
-
You should see the blocks in the admin.
Options are similar to django-flatblocks.
{% flatblock {block} %}
{% flatblock {block} {timeout} %}
{% flatblock {block} using {tpl_name} %}
{% flatblock {block} {timeout} using {tpl_name} %}
{% richflatblock {block} %}
{% richflatblock {block} {timeout} %}
{% richflatblock {block} using {tpl_name} %}
{% richflatblock {block} {timeout} using {tpl_name} %}
- Include more mezzanine flavored goodies (front-end editing, multi site, etc. ).