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 use 
> 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 another 
> one, let's say it's foo.mc, which wants to add to the title. I could probably 
> 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 to be 
in the standard installation), declare attribute 'title' in the Base.mc, and 
change it in the foo.mc. You only need to make sure to do it before the code 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áska                          <la...@kam.mff.cuni.cz>
Katedra Aplikované Matematiky, MFF UK               tel.: +420 739 464 167

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to