Skip to content

Instantly share code, notes, and snippets.

@mbrochh
Created January 16, 2013 11:09
Show Gist options
  • Select an option

  • Save mbrochh/4546400 to your computer and use it in GitHub Desktop.

Select an option

Save mbrochh/4546400 to your computer and use it in GitHub Desktop.
Suggestion for a new templatetag that renders the tags of a post.
@register.inclusion_tag('cmsplugin_blog/tag_links_snippet.html', takes_context=True)
def render_entry_tag_links(context, entry):
"""
Renders the tag links for a given entry.
:param entry: An Entry instance.
"""
context.update({
'tags': Tag.objects.get_for_object(entry)
})
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment