DISQUS

Officially Lucky: django-chunks - Officially Lucky, a blog by Clint Ecker

  • Eric Florenzano · 1 year ago
    This is very cool! I can totally see using this. The best part about it is that it does one thing and does it well :)
  • atl · 1 year ago
    nice. I've been rolling around ideas for a CMS that can ultimately fall back to server-side-includes. This kinda fits as a middle ground to getting there.
  • Clint Ecker · 1 year ago
    Thanks guys! I think NFA could really help out the UI issues.

    Another thing I've been thinking about is some sort of method to include stuff like this when you're editing flatpages. For example, I might want to link to another flatpage, but instead of an anchor link I might want to type:

    `{% link "about-page' %}`

    But, of course, that wouldn't get evaluated because it's not really in the template. Perhaps some sort of template filter. Not sure yet ;)
  • vitalik · 1 year ago
    Thanks!
    Thasts what I where looking for.
  • kevin · 1 year ago
    I have a similar model/concept locally. now it's an OS project and I can dump mine and use yours- awesome!
  • Justin Lilly · 1 year ago
    Fantastic work. Look forward to using this on an upcoming client site! Thanks!
  • Kyle · 1 year ago
    Cool. We built the same concept into our internal CMS.

    For added deliciousness, we wrote a {% render_django %} template tag that will actually allow us to write Django template code as the content for Chunks (or even Flatpages), and render it with the current context.

    It might also be handy in this case :)
  • itavor · 1 year ago
    I've been doing this using plain old flatpages... {% render_flatpage "left" %} in "/news/archive/" will render the flatpage with url "/news/archive/left". The url for flatpages used this way doesn't end in a '/', which makes it easy to filter them out of search results or site maps.
  • Matthias Pronk · 1 year ago
    Nice, I use exactly the same thing on my websites, I call it snippets.
    I apply markdown to the snippets, and save that too in the model (for speed).
  • zero · 1 year ago
    I do the same thing, but I called them "pods!" :)
  • Kyle · 1 year ago
    As I posted above, here's a snippet showing an example of the {% render_django %} tag:
    http://www.djangosnippets.org/snippets/861/
  • Clint Ecker · 1 year ago
    Awesome! I'm going to make a post about your snippet.
  • eurika · 1 year ago
    Hi Malcolm, can you contact us please. Eurika Chambers & Frewin
  • jasondavies · 1 year ago
    Cool stuff, I might use some of this myself...
  • Simon Litchfield · 1 year ago
    Nice! I've actually got something really similar, with a bunch of views, templatetags, optional dynamic form attachments, etc. I'll clean it up and share sometime. It's called 'editable pages' which I use for full pages aswell as chunks like this.
  • mwdiers · 1 year ago
    Amazing. I just spent the last week implementing almost everything mentioned on this page from scratch. Then I find this blog.

    Well, I learned a lot in the process - and most of my code is oriented toward a hierarchical page (using MPTT) and url structure (using a single view to parse url components and dispatch pages), so maybe it was worth doing it from scratch.

    Oh, and I call them GCB's. (Global Content Blocks), and mine support integrated post-rendering (to render tags in content) as well as optionally can be associated with a DB based template. I'll post that eventually.
  • Clint Ecker · 1 year ago
    Sorry about that mwdiers :) However, I've often found the best way to
    learn something is to do it yourself. Happy coding!