[Rote-devel] Nested layouts - doh!
rosco at roscopeco.co.uk
Sun Jan 8 13:24:30 EST 2006
Seems I've been a bit absent minded again with this nested layout thing.
Sure, they work great. Unless you have layouts overriding prior layouts in
COMMON.rb. Worse, if you try to nest using COMMON.rb, they nest backward.
I can think of a couple of ways to fix this:
+ After COMMON.rbs are evaluated, do layout_names.reverse!
+ After COMMON.rbs are evaluated, reset layout_names thus:
@layout_names = [@layout_names.last]
+ Separate 'layout' from 'nested_layout'.
I think I prefer the second alternative. It prevents the COMMON.rb being
used for layout nesting, but I think that's actually a good idea.
COMMON.rb evaluation goes the wrong way for it (as I now see) and it would
also go against the standard COMMON behaviour of overriding COMMONS from
higher up the chain. This change would make layout act as expected from
COMMON.rb, but still allow page and (more importantly) layout code to nest
layouts without being aware of the nesting.
Ross Bamford - rosco at roscopeco.co.uk
More information about the Rote-devel