1. hakanw
  2. django-better-chunks

Commits

hakanw  committed 5bb1e99

First shot at an explanation of the project

  • Participants
  • Parent commits c4dfc68
  • Branches default

Comments (0)

Files changed (1)

File Home.wiki

View file
-== Welcome ==
-
-Welcome to your wiki! This is the default page we've installed for your convenience. Go ahead and edit it.
-
-=== Wiki features ===
-
-This wiki uses the [[http://www.wikicreole.org/|Creole]] syntax, and is fully compatible with the 1.0 specification.
-
-The wiki itself is actually a hg repository, which means you can clone it, edit it locally/offline, add images or any other file type, and push it back to us. It will be live immediately.
-
-Go ahead and try:
-
-{{{
-$ hg clone http://bitbucket.org/hakanw/django-better-chunks/wiki/
-}}}
-
-Wiki pages are normal files, with the .wiki extension. You can edit them locally, as well as creating new ones.
-
-=== Syntax highlighting ===
-
-You can also highlight snippets of text, we use the excellent [[http://www.pygments.org/|Pygments]] library.
-
-Here's an example of some Python code:
-
-{{{
-#!python
-
-def wiki_rocks(text):
-	formatter = lambda t: "funky"+t
-	return formatter(text)
-}}}
-
-You can check out the source of this page to see how that's done, and make sure to bookmark [[http://pygments.org/docs/lexers/|the vast library of Pygment lexers]], we accept the 'short name' or the 'mimetype' of anything in there.
-
-Have fun!
+== 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 ./manage.py 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 %}
+<html>
+    <head>
+        <title>Test</title>
+    </head>
+    <body>
+        <h1> Blah blah blah</h1>
+        <div id="sidebar">
+            ...
+        </div>
+        <div id="left">
+            {% chunk "home_page_left" %}
+        </div>
+        <div id="right">
+            {% chunk "home_page_right" %}
+        </div>
+    </body>
+</html>
+}}}
+
+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 [[http://code.google.com/p/django-chunks/|django-chunks]] which adds i18n multi-language support and lets you tie chunks to sites if you're using {{{django.contrib.sites framework}}}.