Templatetags¶
Core templatetags¶
Core templatetags are automatically loaded for your disposal.
Custom URLs templatetags¶
Lot of what you see here has been stolen from Django’s {% url %} tag.
Get URL using Ella custom URL resolver and return it or save it in context variable.
Syntax:
{% custom_url <FOR_VARIABLE> <VIEWNAME>[[[ <ARGS>] <KWARGS>] as <VAR>] %}
Examples:
{% custom_url object send_by_email %} {% custom_url object send_by_email 1 %} {% custom_url object send_by_email pk=1 %} {% custom_url object send_by_email pk=1 as saved_url %}
Pagination¶
When using any of these, you need to call {% load pagination %}
prior to doing it.
Renders a
inclusion_tags/paginator.htmlorinc/paginator.htmltemplate with additional pagination context. To be used in conjunction with theobject_listgeneric view.If
TEMPLATE_NAMEparameter is given,inclusion_tags/paginator_TEMPLATE_NAME.htmlorinc/paginator_TEMPLATE_NAME.htmlwill be used instead.Adds pagination context variables for use in displaying first, adjacent pages and last page links in addition to those created by the
object_listgeneric view.Taken from http://www.djangosnippets.org/snippets/73/
Syntax:
{% paginator [NUMBER_OF_ADJACENT_PAGES] [TEMPLATE_NAME] %}
Examples:
{% paginator %} {% paginator 5 %} {% paginator 5 "special" %} # with Django 1.4 and above you can also do: {% paginator template_name="special" %}