-
Notifications
You must be signed in to change notification settings - Fork 18
/
cms_plugins.py
29 lines (23 loc) · 985 Bytes
/
cms_plugins.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cmsplugin_facebook import models
class BasePlugin(CMSPluginBase):
name = None
def render(self, context, instance, placeholder):
context.update({'instance': instance, 'name': self.name})
return context
class LikeBoxPlugin(BasePlugin):
model = models.FacebookLikeBox
name = 'Facebook LikeBox Plugin'
render_template = 'cmsplugin_facebook/likebox.html'
class ShareButtonPlugin(BasePlugin):
model = models.FacebookShareButton
name = 'Facebook "Share" button plugin'
render_template = "cmsplugin_facebook/sharebutton.html"
class LikeButtonPlugin(BasePlugin):
model = models.FacebookLikeButton
name = 'Facebook Like Button Plugin'
render_template = 'cmsplugin_facebook/likebutton.html'
plugin_pool.register_plugin(LikeBoxPlugin)
plugin_pool.register_plugin(LikeButtonPlugin)
plugin_pool.register_plugin(ShareButtonPlugin)