NAME

WWW::Kontent::Skeleton - Kontent skeleton (syntax-independent document formatting tree) class

SYNOPSIS

my $skel=WWW::Kontent::Skeleton.new();
$skel.add_node(:tagname<header>, :level(1)).add_text("Merlin's beard!");
$skel.add_node(:tagname<paragraph>);
$skel.children[0].add_tag("Hermione cried.");

DESCRIPTION

The skeleton--a simple, passive N-ary tree--is used to pass information about the page's content and formatting to a renderer to be rendered in the appropriate format. The tagname attribute contains a string specifying the formatting code to be applied, and the children attribute contains an array of child nodes--either other WWW::Kontent::Skeleton objects or plain strings containing text. Any other properties of the node are kept in the properties attribute.

Plain strings should be preserved in the actual document as closely as possible; escaping and tagging should be performed so that all content--including whitespace--is displayed.

Valid tagnames

skeleton

This should always be the top-level node of a skeleton.

paragraph

Represents a paragraph of information.

Has one property, level, ranging between 1 and 4, with lower numbers being more important. (Higher levels are possible but may not be supported by all renderers.)

list

Has one property, type, which may contain either of the values "bulleted" or "numbered". Children must be items.

item

Represents an item in a list.

Represents a hyperlink. Has one property, location, containing a Kontent path or fully-qualified URL. (Kontent paths will never have a colon in them, while URLs always will.) If a link node has no children, most renderers will fill in the page's title.

form

Creates a fill-in form, which when submitted will return to the same page, mode and format as is currently in use.

textfield

Creates a fill-in field for a string of text. The name property gives the name the field's content should be returned as; value indicates the current value of the field; and label gives an optional text label to be displayed for the field. The type property, when set to the value multiline, tells the renderer that a large, multiple-line block of text should be expected.

boolfield

Creates a fill-in field for a boolean value (often a checkbox). The name, value and label properites work as above.

choicefield

Creates a fill-in field for one of several choices. The name, value and label properties work basically as above. The default rendering is usually a drop-down box; however, if type is set to action, the name will also be forced to equal action, and the form will be submitted once an action is chosen. Action fields are often displayed as a set of buttons.

choice

Each choicefield should have several choices. The value property gives the value associated with this choice; any nodes under this one will be used to determine the label text for the choice.

metafield

A metafield is an invisible field carrying information back to the server. The name and value properties work basically as above.

Methods

add_node

Creates a new node and appends it to the current node's list of children. The tag name is passed as the first parameter; any named parameters are treated as node properties.

add_text

Appends one or more text nodes to the current node's list of children.

SEE ALSO

WWW::Kontent

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 97:

=back doesn't take any parameters, but you said =back 4

Around line 151:

=back doesn't take any parameters, but you said =back 4