This came up on IRC the other day and I had an idea on the subject -
I'm not sure if this would actually work well or not, but it can't
hurt to toss it out there :)

I was thinking of some format like so:

{% block foo,bar %}New content{% endblock %}

And having that now override both foo and bar. As for the handling of
block.super, I was thinking that {{ block.super }} would use the
proper parent content for the block it's replacing, so for instance
doing this:

{% block foo,bar %}{{ block.super }} - Some Site{% endblock %}

Would use foo's content when replacing foo, and bar's content when
replacing bar. In addition, if it's at all possible, I was thinking
something along the lines of {{ block.foo.super }} or
{{ block.super.foo }} could be used to grab one specific block's
content (less useful IMO, but I dunno)

Using this idea, the bug tracker title example would look pretty
straightforward:

# parent
<html>
<head>
  <title>{% block title %}Bug System - {% endblock %}</title>
</head>
<body>
  <h1>{% block header %}{% endblock %}</h1>

# child
{% block title,header %}{{ block.super }}{{ object.title }}{% endblock
%}

Which would then render as expected - title would have "Bug System - "
placed in front of the object's title, while header would not.

Ok, I think that about covers my idea, but I'm not really attached to
it if there are problems I'm not noticing :)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to