Friday, March 4, 2011

Using Django pagelets...

One issue that I encountered when using django-pagelets is that clicking on the "Add pagelet" would add a pagelet but it would never render within the page. The problem appears to be that we're missing a content_area parameter, which indicates to the create_pagelet view to apply the pagelet to a section. If you look at The Django admin section, it appears to show a default section, but checking things in the SQL database you'll notice that content_area is set to blank.

The solution is to include these changes into django-pagelets:

https://github.com/rogerhu/django-pagelets/commit/c5bf361dc01eba46f1495a3ab2a7e8efc226dc83

Or at the very least, put this _render_content_area.html in your own templates/pagelets.html to prevent content_area from ever being blank:

https://github.com/rogerhu/django-pagelets/commit/f170fdc60a66b4b4678d87b427edfd0d58aa2b0c

No comments:

Post a Comment