Login

Tag "simple_tag"

Snippet List

split in html template

Html içinde split ile kesme Kesme işleminden sonra kaçıncı bloğun okunacağını düzeltebilme {% kes request.path "/" 3 4 %} gelenveri.split("/")[3:4]

  • template
  • html
  • simple_tag
  • split
Read More

a simple tag with context

simple_tag is nice, but it would be useful if it had a "as variable" clause at the end. This little bit of code factors out the reusable parts and makes a tag almost as simple as simple_tag. Now you can create tags like the following: {% some_function 1 2 as variable %} {% some_function db person %} To add a new function, just do: register.tag("new_function", make_tag(new_function)) (I think you have to take the quotes off a string.)

  • context
  • simple_tag
  • as
Read More

Full Featured Gravatar Tag

Simply returns a created gravatar url based on input. Creates the url utilizing the full gravatar url inputs as defined at http://en.gravatar.com/site/implement/url.

  • tag
  • simple_tag
  • avatar
  • gravatar
Read More

twitter_status

Ah simple_tag for get last update of twitter. How twitter limit the fetch rss so, add cache tag for each 30min ( 60*30) update the twitter. if.

  • template
  • simple_tag
  • twitter
Read More

Slightly better media path tag

A slightly improved version of [snippet #195](/snippets/195/) which keeps the logic but makes use of the `simple_tag` decorator to drastically simplify the code. For an alternative to this sort of tag, check out the media context processor in my [template_utils app](http://code.google.com/p/django-template-utils/).

  • template
  • tag
  • media
  • simple_tag
Read More

5 snippets posted so far.