17. PLUGIN
2. THE PLUGIN MODEL
It's the plugin configuration
class MyPluginModel(CMSPlugin):
title = models.CharField(max_length=200)
posts = models.PositiveIntegerField()
18. PLUGIN
3. THE TEMPLATE
Template is a standard Django template fragment to
which the plugin generated context is provided
<div class="news_list"><h2>{{ instance.title }}</h2>
{% for news in news_list %}
<a href="{{ news.get_absolute_url }}">
{{ news.title }}</a><br>
{% endfor %}
</div>
19. APPHOOK
Is a bridge between the CMS and other Django
applications
In rough terms, it appends the application URLConf to
the page tree
20. It wraps the URLCon in a class
APPHOOK
SOME CODE
class MyApp(CMSApp):
name = _("My App")
urls = ["apps.my_app.urls"]
menus = [MyMenu]
apphook_pool.register(MyApp)
26. FRONTEND EDITOR
ANCHE NEI VOSTRI MODEL
EVERY MODEL CAN BE FRONTEND-ENABLED
{% render_model instance "abstract" %}
{% render_model_block instance %}
<h3>{{ instance.title }}</h3><div class="date">{{ instance.date }}</
{% endrender_model_block %}