Append to site <title> in Django template using block.super -
i have 3 django templates:
base.html
<title>{% block title %} site name {% endblock %}</title>
default.html
{% extends "base.html" %} {% block title %} {{ block.super }} - section name {% endblock %}
main.html
{% extends "default.html" %} {% block title %} {{ block.super }} {% endblock %}
i'd site name in template main.html i.e. content of parent of parent block.
{{ block.super.super }}
is possible?
i don't think possible. specific problem guess can solves if place site name before block, , use block append site name.
otherwise define site_name
in settings.py
, have context processor like
from django.conf import settings def site_name(request): return {'site_name': settings.site_name}
so can use {{ site_name }}
in templates - make sense because site name usefule @ other places too...
Comments
Post a Comment