{% extends 'base.html' %}
{% with title="My title" %}
{% block content %}
Any other content stuff.
{% endblock %}
{% endwith %}
No guarantees. Let us know if it works.
Bill
On Mon, Mar 28, 2011 at 6:18 AM, Vladimir Mihailenco
<vladimir.webdev@gmail.com> wrote:
> Is there any way to override variable of parent (super) template in
> child template? For example, I have following templates:
>
> base.html
> <title>{{ title }}</title>
>
> {% block body %}
> <h1>{{ title }}</h1>
> {% block content %}{% endblock %}
> {% endblock %}
>
>
> child.html
> {% extends 'base.html' %}
>
> {% block content %}
> {% set title %}My title{% endset %}
> {% endblock %}
>
> How to accomplish this using Django templates?
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment