I am trying to integrate Django CMS CKEditor as a field option into my custom model where I need the CMS Plugins such as Filer and Link. I've encountered an PlaceholderField but unsure what this is actually supposed to be used for and haven't been able to find any good tutorials on it.
What is PlaceholderField used for ? I've added it into my model but unsure how to link it with the html field.
title = models.CharField(max_length=200, blank=True, null=True)
content = PlaceholderField('content')```
The
PlaceholderField
brings the functionality you usually get from CMS page templates when you do{% placeholder "content" %}
to your own models.This is great for an app like news, where a news article might have all kinds of different content. Using a
PlaceholderField
would mean that in the template rendering your news object you could do something like;Then in the frontend, looking at that page, you'd get the same structure view from CMS showing your placeholder from which you can add CMS plugins to it.
This is a brilliant way to bring all the third party plugins, as well as any you've made for CMS pages to your models.
The docs on this are here; http://docs.django-cms.org/en/latest/how_to/placeholders.html