%flags> # specify a layout file to inherit from inherit = 'layout.myt' %flags> <&|SELF:section, name='title' &> Myghty Really Advanced Layout Demo &> <&|SELF:section, name='header' &>
In this example, the autohandler calls upon m to fetch both its immediate subclass and the subclass of that subclass. The "sub-sub-class", which represents the ultimate file being served, is called to populate the content dictionary first. Then the "subclass", which defines the layout, is called with the newly populated content dictionary as its arguments, which it references via the %ARGS section.
This allows pages to select their own layout component, and also makes the creation of new layouts easy as they contain virtually no python code except straight variable substitutions. With layout and content in separate templates, brought together by the autohandler, the design is extremely close to the "model-view-controller" paradigm.
&> <&|SELF:section, name='leftnav' &> Left Nav