PageKit Template Tags

PageKit Templates are templates that contain HTML::Template-esque tags. They are either stored as files in the View directory or generated from XSLT transformations. There are three main classes of tags, XML content tags, Model tags, and PageKit tags.

XML content tags

CONTENT_VAR - Extract a node from an XML file using XPath.
CONTENT_LOOP - Extract a set of nodes from an XML file using XPath.
CONTENT_IF, CONTENT_UNLESS, CONTENT_ELSE - Displays enclosed section if content sets value to true/false.

Content tags use XPath queries to retreive data from XML Content files. The XML::LibXML and HTML::Template::XPath modules are used behind the scenes.

Model tags

MODEL_VAR - Filled in with scalar value set from Model's output method
MODEL_LOOP - Filled in with array reference of hash references set from Model's output method.
MODEL_IF, MODEL_UNLESS, MODEL_ELSE - Displays enclosed section if model sets value to true/false.

Model tags refer to data set by the output method of the model classes. They correspond to the HTML::Template. The PageKit pre-processor simply replaces MODEL with TMPL before running the template through HTML::Template.

PageKit tags

PKIT_COMMENT - Write comments inside your templates. The comments are stripped out of your source. Before it is delivered.
PKIT_COMPONENT - Include templates and associate model code.
PKIT_ERRORSTR - Named field for your errorstr.
PKIT_MACRO - Placeholder for components.
PKIT_ERRORFONT - Highlights Invalid Fields
PKIT_ERRORSPAN - Highlights Invalid Fields
PKIT_HAVE_MESSAGES - Include the block between <PKIT_HAVE_MESSAGES> and </PKIT_HAVE_MESSAGES> only, if one or more messages are avail.
PKIT_HAVE_NOT_MESSAGES - Include the block between <PKIT_HAVE_NOT_MESSAGES> and </PKIT_HAVE_NOT_MESSAGES> only, if no messages are avail.
PKIT_HOSTNAME - Fills in the hostname in the URL.
PKIT_MESSAGES - Display messages passed to pkit_message method.
PKIT_SELFURL - URL of current page.
PKIT_VIEW - Wraps a section of text to be displayed for a view.
PKIT_ELSE - Can be used to add a else part to PKIT_... tags.
PKIT_IS_ERROR - Used to display messages only if it is a errormessage.
PKIT_NOT_ERROR - Used to display messages only if it is a NOT a errormessage.

PageKit tags refer to data that is set by the PageKit controller. These correspond to functionality or utility functions that are common across different web applications.