AddThis Social Networking TemplateTag

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#your/templatetag.py

@register.inclusion_tag('blog/add_this.html')
def add_this(url,title):
        from django.contrib.sites.models import Site
        site = Site.objects.get_current()

        from django.conf import settings
        username = settings.ADD_THIS_USERNAME
        return {'url': url, 'title': title, 'username': username, 'site': site }

More like this

  1. Template tags to integrate with modconcat by matthanger 2 years, 6 months ago
  2. FCKEditor replace all vLargeTextField in admin by aronchi 3 years, 3 months ago
  3. Unobtrusvie Foldable Admin Interface by whiteinge 4 years ago
  4. Add extra form elements in your contib admin by sergejdergatsjev 3 years, 2 months ago
  5. A dict template tag by Batiste 3 years, 9 months ago

Comments

kenbolton (on June 9, 2009):

the signature for the add_this() function is: (url,title)

the templatetag example has them reversed: {% add_this post.title post.get_absolute_url %}.

#

(Forgotten your password?)