[Nitro] how to initialize @color and make it visible into the template?

Kirk Haines wyhaines at gmail.com
Mon Jul 9 16:08:45 EDT 2007

On 7/9/07, Arne Brasseur <arne at arnebrasseur.net> wrote:
> Jimmy Jazz schreef:
> ...
> > but Nitro seems to ignore @color wherever you declare it (controller,
> > template, <?r ?>, %{}, etc.). Any advice ?
> Just do like this in your template: <Box color="#e3f" />.
> The thing with templates that confused me in the beginning also is that
> they are rendered only once, the first time a page is loaded. So if you
> evaluate code in an element the result should always be the same, or
> generate template code.
> So if you want to access instance variables set in a controller, you
> need to generate code to do that, and not do it directly.

I've read this a couple of times, but I think I still need it
explained to me a bit more, because I am not quite sure I understand.

Let's say I have something....an online community site of some sort.
I want to have a little box in one corner of the page that shows the
time and date, whether the user has any new messages in their mailbox,
and some other stuff that may change regularly.

To be nice and modular, I want to have something like this in my page template:

<InfoBox foo="bar" blah="snog" whatever="snow white" />

InfoBox is that thing with all that information.

Now, in InfoBox's template, are you saying that all the content has to
be generated programatically, because that template will only ever be
rendered once, so I can't just dynamically include data generated a
method call into it?  Or do I misunderstand you?

Kirk Haines

More information about the Nitro-general mailing list