blob: d0fbe3854d4bb659ff56626f31de3e074b886810 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
{% extends "layout.html" %}
{% load i18n %}
{% block title %}Foo{% endblock %}
{% block page-body %}
{{ block.super }}
Hello {{ name|cut:"d" }}!
{% for item in seq reversed %}
{% if forloop.index|divisibleby:2 %}
<li class="{% cycle 'a' 'b' %}">{{ item }}</li>
{% endif %}
{% endfor %}
{% ifequal foo bar %}
haha
{% else %}
hmm
{% endifequal %}
{% filter upper %}
{% include "subtemplate.html" %}
{% include foo %}
{% endfilter %}
{% spaceless %}
Hello World
{{ foo }}
Hmm
{% endspaceless %}
{% templatetag opencomment %}...{% templatetag closecomment %}
{% url foo a, b, c=d %}
{% url foo a, b, c=d as hmm %}
{% with object.value as value %}
<img src='bar.gif' height='10' width='{% widthratio value 200 100 %}'>
{% endwith %}
<pre>{% debug %}</pre>
{% blocktrans with book|title as book_t and author|title as author_t %}
This is {{ book_t }} by {{ author_t }}
{% endblocktrans %}
{% blocktrans count list|length as counter %}
There is only one {{ name }} object.
{% plural %}
There are {{ counter }} {{ name }} objects.
{% endblocktrans %}
{% blocktrans with name|escape as name count list|length as counter %}
There is only one {{ name }} object.
{% plural %}
There are {{ counter }} {{ name }} objects.
{% endblocktrans %}
{% blocktrans %}This string will have {{ value }} inside.{% endblocktrans %}
<p>{% trans "This is the title." %}</p>
{% regroup people by gender as grouped %}
{% endblock %}
|