I just want to define id attribute of body tag in child template. First solution works perfectly:
base.html:
[body{% block bodyid %}{% endblock %}]
child.html:
{% block bodyid %} id="myId"{% endblock %}
It's simple and cool! But I don't like to point id="myId" in every child template. I want just send value 'myId' to parent template, where it put to id="....". So, I invent this method:
base.html:
[body{% block bodyid %} id={{ bodyid }}{% endblock %}]
child.html:
{% block bodyid %}
{% with 'myId' as bodyid %}
{{ block.super }}
{% endwith %}
{% endblock %}
But it's terrible and tedious to compare first solution. Is there any good method to do this?
This problem is deeper, than managing bodyId. I think, I try to find and organize subtemplate system through standard django template's inheritance.