I'm trying to customise a CMS written in Django. The content editors aren't flexible enough so I'm trying to come up with a better solution.
Without over-explaining it, I'd like it to be a bit like django-better-chunks or django-flatblocks
. You set up an editable region entirely from within the template. I want to bind these editable regions to a mix of strings and object instances. One example would be having multiple editable regions based on one product:
{% block product_instance "title" %}
{% block product_instance "product description" %}
So if you have a view with another product as product_instance
those two blocks
would show different data. I would also see there being use for site-wide blocks that only pass through the string part. Essentially, I would like to be able to pass 1-infinity identifiers.
But I'm really struggling on two fronts here:
How do I define the relationship between the mixed identifier and the actual content "
block
" instance? I have a feeling contenttypes might feature here but I've really no idea where to start looking!And how do I write a template tag to read the above syntax and convert that into an object for rendering?