forked from ungleich-public/dynamicweb
clone cms with menus, make menus standalone app
This commit is contained in:
parent
1ece5ce7c7
commit
afb096b7a3
1153 changed files with 318897 additions and 37 deletions
30
cms/test_utils/project/pluginapp/plugins/link/cms_plugins.py
Normal file
30
cms/test_utils/project/pluginapp/plugins/link/cms_plugins.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from cms.plugin_base import CMSPluginBase
|
||||
from cms.plugin_pool import plugin_pool
|
||||
|
||||
from .models import Link
|
||||
|
||||
|
||||
class LinkPlugin(CMSPluginBase):
|
||||
model = Link
|
||||
name = 'Link'
|
||||
text_enabled = True
|
||||
allow_children = True
|
||||
render_template = 'pluginapp/link/link.html'
|
||||
|
||||
def render(self, context, instance, placeholder):
|
||||
context['link'] = instance.get_link()
|
||||
return super().render(context, instance, placeholder)
|
||||
|
||||
|
||||
class BuggyPlugin(CMSPluginBase):
|
||||
name = 'Bugs Bunny'
|
||||
|
||||
render_template = 'pluginapp/link/bugs.html'
|
||||
|
||||
def render(self, context, instance, placeholder):
|
||||
context["result"] = 1 / 0 # Finally we'd find out, won't we?
|
||||
return super().render(context, instance, placeholder)
|
||||
|
||||
|
||||
plugin_pool.register_plugin(LinkPlugin)
|
||||
plugin_pool.register_plugin(BuggyPlugin)
|
||||
Loading…
Add table
Add a link
Reference in a new issue