blog.templatetags package

Submodules

blog.templatetags.blog_extras module

Some custom templatetags simplifying article rendering in templates

blog.templatetags.blog_extras.article_content(slug)[source]

Simple temlatetag to retrieve article’s content by slug. If article is django template, it’s content is rendered

blog.templatetags.blog_extras.article_panel(slug, header_link=False, show_creation_time=False)[source]

Incluision tag that renders article content. Base template is ``blog/article_panel. Currently is basic bootstrap panel

This templatetag is used in blog/article_list.html, blog/article_detail.html.

Parameters:
  • slug (str) – article’s slug
  • header_link (bool) – If True then article header is a link to blog.views.ArticleDetail
  • show_creation_time (bool) – If True then publication datetime is shown.
Returns:

rendered article template

blog.templatetags.blog_extras.article_title(slug)[source]

Simple temlatetag to retrieve article’s content by slug. If article is django template, it’s content is rendered

blog.templatetags.blog_extras.get_article(slug)[source]

Templatetag that returns article (variable with all article data) by it’s slug.

Can be used in templates to manualy display article on a page

Parameters:slug (str) – Article’s slug
Return Article:blog.models.Article instance

Module contents