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. FCKEditor replace all vLargeTextField in admin by aronchi 4 years, 7 months ago
  2. Add special field lookups to the Admin list_filter display by whiteinge 5 years, 4 months ago
  3. Template tags to integrate with modconcat by matthanger 3 years, 11 months ago
  4. Add extra form elements in your contib admin by sergejdergatsjev 4 years, 6 months ago
  5. Unobtrusvie Foldable Admin Interface by whiteinge 5 years, 4 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?)