Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge https://github.com/CreativeCubes/django-cms-facebook into oversize

  • Loading branch information...
commit 1316e91a40628752930cbc70de2804207d7e314b 2 parents 1cefea4 + 7ab4e4f
@chrisglass authored
View
0  cms_facebook/templatetags/__init__.py
No changes.
View
26 cms_facebook/templatetags/cms_facebook_tags.py
@@ -0,0 +1,26 @@
+from django import template
+from django.template.loader import render_to_string
+
+register = template.Library()
+import settings
+
+@register.simple_tag
+def cms_facebook_likebox(likebox_name):
+ from cms_facebook.models import LikeBox
+ try:
+ likebox = settings.CMS_FACEBOOK_LIKEBOX[likebox_name]
+ except LookupError:
+ return "LikeBox Settings not found"
+ instance = LikeBox(**likebox)
+ return render_to_string("cms_facebook/likebox.html", {"instance" : instance})
+
+
+@register.simple_tag
+def cms_facebook_likebutton(likebutton_name):
+ from cms_facebook.models import LikeButton
+ try:
+ likebutton = settings.CMS_FACEBOOK_LIKEBUTTON[likebutton_name]
+ except LookupError:
+ return "LikeButton Settings not found"
+ instance = LikeButton(**likebutton)
+ return render_to_string("cms_facebook/likebutton.html", {"instance" : instance})
View
2  cmsplugin_facebook/models.py
@@ -96,4 +96,4 @@ class FacebookLikeButton(CMSPlugin):
fb_default_width = 295
def __unicode__(self):
- return "LikeBox (%s)" % (self.pageurl)
+ return "LikeButton (%s)" % (self.pageurl)
View
2  cmsplugin_facebook/templates/cmsplugin_facebook/likebutton.html
@@ -17,7 +17,7 @@
<iframe src="http://www.facebook.com/plugins/like.php?
href={% autoescape on %}{{ instance.pageurl }}{% endautoescape %}&amp;
layout={% if instance.layout %}{{instance.layout}}{% endif %}&amp;
- show_faces={% if instance.show_faces %}{{instance.show_faces}}{% endif %}&amp;
+ show_faces={{instance.show_faces}}&amp;
width={% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}&amp;{% endif %}
height={{ instance.height }}
action=like&amp;
Please sign in to comment.
Something went wrong with that request. Please try again.