Login

Tag "links"

Snippet List

Hyperlink list filter

This is a simple filter that takes an object list and returns a comma-separated list of hyperlinks. I use it to display the list of tags in my blog entries. The function assumes the object has a `get_absolute_url()` method that returns the URL. In your template, write `{{ obj_list|hyperlink_list:"slug" }}` where `obj_list` is your object list and `"slug"` is the object's attribute that returns the link text.

  • filter
  • templatetag
  • links
  • template-tag
  • link
  • hyperlink
Read More

Link filter

Almost too dumb to be worth posting but its saved me a lot of typing. Instead of: <div> <a href="{{ object.get_absolute_url }} class="object-icon">{{ object }}</a> </div> just put: <div>{{ object|link }}</div>

  • filter
  • links
Read More

"Link To" helper tag

Simple template tag that assumes some common conventions in order to quickly get a link to a specific model instance.

  • template
  • models
  • links
  • tags
  • anchors
Read More

Whore links

Finds links from a body of html so you can display them elsewhere.

  • beautiful-soup
  • links
Read More

4 snippets posted so far.