Default content plugin in django-cms Default content plugin in django-cms django django

Default content plugin in django-cms


There's a simple way to achieve the same functionality:

Provide a number of "prototype pages", one for each combination of page template and instantiated plugins you want to be available to the customer.

Have the customer create new pages by copying the template pages (can be done via the copy icon in the pages admin) rather than making a new page from scratch. In this way the required plugins will already be there, even with a default content if you wish.


Do you even need the CMS module?

The most basic of CMS's is nearly trivial using out-of-the-box django:

class ContentPage(models.Model):   title = models.CharField(max_length=100)   content = models.TextField()   slug = models.SlugField()def view_page(request, slug='home'):   return render_to_response('content.html',        { 'page':  ContentPage.objects.get(slug=slug) },        context_instance=RequestContext(request)    )

Just use the django admin to get started. But if you want more, and not give them the admin it's pretty easy to knock up a form/action to edit these fields.

If you need wysiwyg editing add tinymce to the form template. Something like:

 <script type="text/javascript" src="{{MEDIA_URL}}tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({...

or (as mentioned by 'sayplastic') if you are still editing pages via through the admin you can attach Tiny to that too

class Media:    js = (        settings.MEDIA_URL + "jquery/jquery.js",        settings.MEDIA_URL + "tiny_mce/tiny_mce.js",        settings.MEDIA_URL + "js/admin.js"    )