Clone wiki

django-better-chunks / Home

About django-better-chunks

Think of it as flatpages for small bits of reusable content you might want to insert into your templates and manage from the admin interface.

By adding chunks to your installed apps list in your Django project and performing a ./ syncdb, you'll be able to add as many "keyed" bits of content chunks to your site.

The idea here is that you can create a chunk of content, name it with a unique key (for example: home_page_left_bottom) and then you can call this content from a normal template.

Example Usage

{% load chunks %}
        <h1> Blah blah blah</h1>
        <div id="sidebar">
        <div id="left">
            {% chunk "home_page_left" %}
        <div id="right">
            {% chunk "home_page_right" %}

This is really helpful in those cases where you want to use django.contrib.flatpages but you need multiple content areas.

django-better-chunks is a fork off Clint Ecker's project django-chunks. It adds i18n multi-language support and lets you tie chunks to sites if you're using django.contrib.sites.