{# Basic extension of a common file #}
{% extends "base_file.html" %}
{% block title %}{{ section.title }}{% endblock %}
{% block content %}
{{ section.title }}
{# For loop example #}
{% for item in item_list %}
href="{{ item.get_absolute_url }}">
{{ item.text }}
{{ item.other_text|upper }}
{{ story.longer_text|truncatewords:"100" }}
{% endfor %}
{% endblock %}
{# For loop example with specific content if empty #}
{% for item in other_list %}
{{ item.text }}
{% else %}
This list is empty
{% endfor %}
{% endblock %}
{# if example #}
{% if item_list %}
Number of items: {{ item_list|length }}
{% elif some_condition %}
Show this text
{% else %}
Nothing to process
{% endif %}
{# This is a comment #} hello comment
{# Translation example #}
{% translate "Title" as title %}
{% block content %}{{ title }}{% endblock %}
{# Auto-escaping #}
{% autoescape off %}
Hello {{ name }}
{% endautoescape %}
{# Loading custom tags/libraries #}
{% load humanize %}