On May 5, 10:28 pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
> This implementation will not work recursively. You will be able to
> call {{super name}}, however it will only be able to include blocks
> that were declared in its immediate parent, it cannot for instance,
> include a blocknode from a grandparent or older.
>
> Meaning, if you declare {{block title}} in layout.html, and then you
> have a {{block content}} in body.html and body.html extends
> layout.html. So when you call index.html which inherits from body.html
> it will only have access to {{super content}}... you will not be able
> to {{super title}} because there is no way for
>
> I could contain a list of all blocks defined in a given parsing, and
> use that as a global lookup, however children blocks would always
> override their parent, and by definition you cant super a block that
> doesn't exist yet.
>
> I think this is the way I will go. Don't mind my thinking out typing :)

No worries - that's what I've done, and the cream will rise to the
top...

Note:  do blocks contain blocks?
That is, I hope we do like html:  allow nesting, but not a generic
graph of nodes.

Think like Easy-CSS wrappers.

....

I need sleep; I'll look at this tomorrow;  I have faith that Thadeus,
when he pays this much attention, will come up with some good
ideas :-)

- Yarko
>
> --
> Thadeus
>
> On Wed, May 5, 2010 at 10:14 PM, Thadeus Burgess <thade...@thadeusb.com> 
> wrote:
> > I can't really say, we need some tests to analyze the effects of this.
>
> > I am thinking of a way that might not include any extra overhead at all.
>
> > --
> > Thadeus
>
> > On Wed, May 5, 2010 at 10:02 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
> >> Before you go and implement this can you assess if this will affect
> >> the speed of template processing?
>
> >> On May 5, 9:57 pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
> >>> It might be possible for the parent to look into its children, and
> >>> analyze the child blocks, and if a block in the child contains a
> >>> {{super <me>}} it can then take its own value and replace it into the
> >>> {{super me}}.
>
> >>> --
> >>> Thadeus
>
> >>> On Wed, May 5, 2010 at 9:56 PM, Thadeus Burgess <thade...@thadeusb.com> 
> >>> wrote:
> >>> > Right.
>
> >>> > As much as I would like the functionality... This cannot be done as
> >>> > the system stands. Child templates know nothing of their parent,
> >>> > therefore they are unable to request anything from the parent
> >>> > template.
>
> >>> > The way that you effectively override a block is by effort of the
> >>> > parent looking at all its children and going "Hey, you have the same
> >>> > block I do, so I will use yours".
>
> >>> > So the way to do this, is for the child to know about its parent, and
> >>> > its parents parents, and parents parents parents (etc, depending on
> >>> > the level of hierarchy.) The issue is, how does this element then
> >>> > determine which parent it should pull from, assuming the grandparent
> >>> > defines a block, and the parent overrides the block, what is left is
> >>> > not what is intended.
>
> >>> > --
> >>> > Thadeus
>
> >>> > On Wed, May 5, 2010 at 8:28 PM, Yarko Tymciurak
> >>> > <resultsinsoftw...@gmail.com> wrote:
> >>> >> nyway, I don't know what the right syntax / implementation (exactly)
> >>> >> of a template "super" function is - I just know it makes sense, and I
> >>> >> think we should have it (I am certainly investing a lot of effort in
> >>> >> driving exploration of how it would work, look, and w

Reply via email to