Revision 1 as of 2005-03-22 05:44:02
missing edit-log entry for this revision
converted to 1.6 markup
|Deletions are marked like this.||Additions are marked like this.|
|Line 1:||Line 1:|
|With the [wiki:/VelocityOnlyLayout change to VelocityOnlyLayout] from the ["VelocityECSLayout"], the idea has come up (again) for a way to embed layouts.||With the [[/VelocityOnlyLayout|change to VelocityOnlyLayout]] from the [[VelocityECSLayout]], the idea has come up (again) for a way to embed layouts.|
This idea has been thrown around before by Rafal Krzewski:
Some time ago, an idea crossed my mind, that we might want to introduce another layer of templating, namely Page template. It would contain the common elements of all Layout templates used in conjuncion with VelocityOnlyLayout class. An application will use precisely one Page template, the same way as it uses single Page class now. This would bring us back to the separation between head and body parts of the page we had with ECS, but with template driven customization of head elements available to the developer.
A variation on this idea was proposed by Chris Felaco:
I had added a hackHHHHfeature to my customized Layout to enable layouts to be embedded within other layouts. This way you can have a standard layout containing just the basic HTML HEAD and BODY tag stuff, and then reuse that layout in other layouts.
The way to do it is for the layout template itself to change the layoutTemplate in the TemplateInfo. When the Layout class is done rendering the template using Velocity, it checks if the layoutTemplate name was changed, and if so, it sets the $screen_placeholder to the original layout content and then renders the new layout template. Repeat as necessary. The explanation is not very clear - here's the basic code: