Skip to content.

Etria Lists

 

[quills-dev] Re: 1.5 final?

Justizin justizin at siggraph.org
Tue Nov 7 23:22:01 UTC 2006


I must have needed sleep badly when I wrote the first message.. heh.

---------- Forwarded message ----------
From: Justizin <justizin at siggraph.org>
Date: Nov 7, 2006 5:19 PM
Subject: Re: [quills-dev] Re: 1.5 final?
To: Michael Reitsma <mreitsma at gmail.com>


On 11/7/06, Michael Reitsma <mreitsma at gmail.com> wrote:
> Hi.
>
> Thx for your answer.
>
> >Don't fight the macro feeling.
> Well i wasn't aware that i was really...

Just trying to be catchy..

> >to shove an HTML fragment into an
> >object's view without the object asking for it, unless there is a slot
> >of sort.
>
> Huh ?
> I saw it like this , which is i think sort of what you're saying, :
> An object gets rendered to html by whatever template (or code actually ) is
> called on a specified method.
> An object probably has a default method for rendering. And special ones for
> specific actions. Such as the /thumbnail or /mini methods on a Image.
> I was talking about a template that renders a weblog.
> In this template a macro gets called that renders the byline. I know (most
> logically) that 'here' refers to the object that was called initially ,
> being the weblog here.
> The macro renders the byline for an object called 'here'. Here is the weblog
> itself in this case.
> I know that if i put/use some other variable name in the macro, like
> 'there', the 'there' should be declared in the calling template.
> Which makes sense because all this stuff is in the same namespace, or global
> in old-skool speak.
> Now the weblog view template iterates over all of the containing entries to
> show these.
> They have a byline as well. So to render the bylines for every entry i can
> not call the same by-line macro because that uses 'here' and 'here' refers(
> ya' know global ?) to the weblog.
> This is where the
> create-another-byline-macro-which-does-exactly-the-same
> comment pops up.
> So if i could call the macro and hand an object every time i called it, and
> the macro would process that object, i would only need one macro to render
> the byline for the weblog and the weblogentries....
>
> Hence the remark about functions and handing over objects to templates like
> functions.

Short answer: you should be able to do this, with a view or viewlet, i think.

Long answer: within the context of TAL itself, this isn't practical,
because you may want to access both "here", the current context, and
"item", a contained object you are itemizing, in the same snippet of
code, and overloading the context wouldn't allow that.

Even calling a view from within a TAL statement might not be a great
idea, it feels like fighting the framework to me, but people are wrong
all the time.

Do what works.

-- 
Justizin, Independent Interactivity Architect
ACM SIGGRAPH SysMgr, Reporter
http://www.siggraph.org/


More information about the quills-dev mailing list