# icons.py by Hangya # # Add this to CSS: # .icon { padding-left: 20px; background-repeat: no-repeat;} # # use at least 20px line-height for best experiences # # Download icons from http://www.famfamfam.com/lab/icons/silk/ # Upload them to your MEDIA_URL's icons subdirectory. # # Template usage: # {% load icons %} # # Login #

{{ user.username }}

#

Please subscribe to our RSS feed.

# # etc. from django import template from django.conf import settings register = template.Library() def icon(icon_name): return 'class="icon" style="background-image:url('+settings.MEDIA_URL+'/icons/'+icon_name+'.png);"' register.simple_tag(icon) def listicon(icon_name): return 'style="list-style-image:url('+settings.MEDIA_URL+'/icons/'+icon_name+'.png);"' register.simple_tag(listicon)