Next Previous Up Top Contents Index

WebMaker User Guide

9.7 Overview of node rules

A WML file can contain definitions of node rules. A node rule specifies the appearance of web pages that use that node rule, such as the header and footer of the web page. A node rule is a template for the nodes. The header and footer typically contain navigation panels, which provide hypertext links for navigating your web of documents. A node rule is used by one or more paragraph rules. Each paragraph that starts a new node must use a node rule.

You can view the WML statement for a node rule by viewing the WML file in an ordinary text editor. For example:

NODE TOCNode
{
  TITLE headingtext()
  HEADER
  {  
    @NavPanel=concatenate( 
              button("[Next] ", filename(next), "[Next]" ), 
              button("[Previous] ", filename(previous),                                                    "[Previous]"),
              button("[Top] ", filename(top), "[Top] " ),
              button("[Index] ", filename(INDEX), "[Index] " )
                         );
    write(*,paragraph(@NavPanel));
    write(*,paragraph(maintitle()));
  }
  FOOTER
  {
    write(*,toc(4,global));
    write(*,hrule());
    write(*,address(concatenate(maintitle()," - ",date())));
    write(*,paragraph(@NavPanel));
  }
}

For completeness, we show a paragraph rule that uses this node rule. The line NEWNODE TOCNode is the place where this paragraph rule specifies that it starts a new node, and that the node is defined by the TOCNode rule.

PARAGRAPH "ExtTOCHeading-TocNode" TYPE Heading
{
  LEVEL 1
  FILENAMEKEY TOC
  NEWNODE TOCNode
  ACTIONS
  {
    write(*,heading(1,text()));
    write(*,hrule());
  }
}