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