Web Oriented Object Framework

User Guide (Version 0.5b4)

User Guide (Version 0.5b4)

Page sections

A page section is the HTML content of a specific area within a Web page, for example, the header area. Page sections may be generated by a controller method, or from a template containing a mixture of HTML content and Tcl code.

The page object

By convention, layouts expect to retrieve their page sections from the page object, of class Page, that is created by the controller for every request. This object will return the raw HTML content of a specified page section through its fetch method. For example, the following is a fragment from a layout template.

% if {[page fetch header header_content]} {
% }

If the page object has a header section defined, or can generate one, it returns the content of that section in header_content and returns true. Otherwise it returns false. The layout template fragment conditionally includes that content, braced by horizontal rules.

The page object may be populated with page sections in one of two ways.

The following sections describe both these methods.