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
- Template tags to integrate with modconcat by matthanger 2 years, 6 months ago
- FCKEditor replace all vLargeTextField in admin by aronchi 3 years, 3 months ago
- Unobtrusvie Foldable Admin Interface by whiteinge 4 years ago
- Add extra form elements in your contib admin by sergejdergatsjev 3 years, 2 months ago
- A dict template tag by Batiste 3 years, 9 months ago
Comments
the signature for the add_this() function is: (url,title)
the templatetag example has them reversed: {% add_this post.title post.get_absolute_url %}.
#