Module reahl.web.layout

New in version 3.2.

Utilities to deal with layout.

PageLayout

class reahl.web.layout.PageLayout(document_layout=None, contents_layout=None, header_layout=None, footer_layout=None)

A PageLayout creates a basic skeleton inside an reahl.web.ui.HTML5Page, and optionally applies specified Layouts to parts of this skeleton.

The skeleton consists of a Div called the document of the page, which contains three sub-sections inside of it:

  • the .header – the page header area where menus and banners go;

  • the .contents of the page – the main area to which the main content will be added; and

  • the .footer – the page footer where links and legal notices go.

Parameters
  • document_layout – A Layout that will be applied to .document.

  • contents_layout – A Layout that will be applied to .contents.

  • header_layout – A Layout that will be applied to .header.

  • footer_layout – A Layout that will be applied to .footer.

Styling

Adds a <div id=”doc”> to the <body> of the page, which contains:

  • a <header id=”hd”>

  • a <div id=”contents”>

  • a <footer id=”ft”>

New in version 3.2.

header

The reahl.web.ui.Header of the page.

contents

The reahl.web.ui.Div containing the contents.

footer

The reahl.web.ui.Footer of the page.

document

The reahl.web.ui.Div containing the entire page.

header_layout

A reahl.web.fw.Layout to be used for the header of the page.

contents_layout

A reahl.web.fw.Layout to be used for the contents div of the page.

footer_layout

A reahl.web.fw.Layout to be used for the footer of the page.

document_layout

A reahl.web.fw.Layout to be used for the document of the page.

customise_widget()

Override this method in subclasses to allow your Layout to change its Widget upon construction. There is no need to call super(), as the superclass implementation does nothing.