added plugins for digitalglarus
This commit is contained in:
parent
4ddf70777d
commit
ea1c24e5d1
1 changed files with 19 additions and 0 deletions
19
digitalglarus/cms_plugins.py
Normal file
19
digitalglarus/cms_plugins.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
from cms.plugin_base import CMSPluginBase
|
||||||
|
from cms.plugin_pool import plugin_pool
|
||||||
|
from .models import DGGalleryPlugin
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
|
class CMSGalleryPlugin(CMSPluginBase):
|
||||||
|
model = DGGalleryPlugin
|
||||||
|
name = _("Digital Glarus Gallery")
|
||||||
|
render_template = "digitalglarus/gallery.html"
|
||||||
|
|
||||||
|
def render(self, context, instance, placeholder):
|
||||||
|
context.update({
|
||||||
|
'gallery':instance.dgGallery,
|
||||||
|
'object':instance,
|
||||||
|
'placeholder':placeholder
|
||||||
|
})
|
||||||
|
return context
|
||||||
|
|
||||||
|
plugin_pool.register_plugin(CMSGalleryPlugin)
|
Loading…
Reference in a new issue