Re: Questions about variable propagation and custom component types

Ladislav Laska <[email protected]> Sun, 7 Sep 2014 11:25:41 +0200
Newsgroups gmane.comp.web.mason.user
Message-ID <[email protected]>
On Sat, Sep 06, 2014 at 11:03:00PM +0200, Ladislav Laska wrote:
> Hi!
> =

> The last project I've done with Mason was a success, so I've decided to u=
se it =

> yet for another one. This time, there is a challenge to it, and since the =

> documentation is not exactly helping, I've decided to consult here again =
:-)
> =

> I have two questions. Let me start with the simple one:
> =

> 1) How do I propagate a variable Up the component tree? The use case is =

> simple: I have Base.mc, which defines most of the page layout, and anothe=
r =

> one, let's say it's foo.mc, which wants to add to the title. I could prob=
ably =

> find a way to hack it by studying the generated class files, but surely, =
there =

> must be a simpler way.

So the final solution for that is to use plugin "LvalueAttributes" (seems t=
o be =

in the standard installation), declare attribute 'title' in the Base.mc, an=
d =

change it in the foo.mc. You only need to make sure to do it before the cod=
e of =

the base is executed, that is for example in <%before render> block.

Thanks for the hints, I'll work on the others now :-)



-- =

S pozdravem Ladislav L=E1ska                          <[email protected]=
z>
Katedra Aplikovan=E9 Matematiky, MFF UK               tel.: +420 739 464 167

---------------------------------------------------------------------------=
---
Slashdot TV.  =

Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/