Meta: Websites Template
OpenPKG Meta provides the uniform page canvas template for all
OpenPKG websites. The canvas template provides both a uniform
visual representation and the various generated elements (navigation
tabs on the top, navigation bar or bread crumbs on the top and right
hand side, navigation cross-references and walk-through paths on
the right hand side, etc). It is also flexible enough to provide
both 1-pane or 2-pane layouts and a fixed or variable width content
area. Finally, it plays some DHTML tricks with CSS and JavaScript
to provide unobtrusive but noticable semi-transparent effects.
Canvas Template Requesting
The uniform page canvas template is available under the URL
http://meta.openpkg.org/canvas.php.
It provides the following major URL
QUERY_STRING options:
- path=<element1>.<element2>…
This is the path of dot-separated path elements to the active
page in the websites navigation
tree. The path has to match the "id"
attribute of the "li" element of a page in the navigation tree source text.
For instance "project.registry.help" is the path
for the help page of the OpenPKG Registry.
- pane={1,2}
This selects whether the canvas uses a 1-pane or 2-pane (default) layout.
The 2-pane layout provides a collapsed navigation tree in a side-bar on the right hand side.
The 1-pane layout provides a full-width body and just a navigation path at the top.
- stretch={body,margin}
This selects whether the canvas body or the margin (default) stretches to
fill the browser viewport. Stretching the margin is preferred as it
doesn't destroy the canvas visual layouting. Stretching the body is
useful (especially in combination with "pane=1") for content
having a very large width.
Canvas Template Content
The resulting content is a HTML page containing three markers:
- <!-- CANVAS: HEAD -->
This is where content intended for the HTML <head>
element has to be inserted by the consumer.
- <!-- CANVAS: BODY -->
This is where primary content (rendered in the main content area)
intended for the BODY <head> element has to be inserted by
the consumer.
- <!-- CANVAS: SIDE -->
This is where secondary content (rendered in the side-bar content
area) intended for the BODY <head> element has to be
inserted by the consumer.
Canvas Template External References
The generated HTML page references various additional
data (JavaScript, CSS, graphics, etc) from
meta.openpkg.org
via the
local URL prefix
/meta/..
This is important as some browsers do not allow referenced content to
be loaded externally (e.g. Internet Explorer doesn't allow to load
JavaScript from an external URL).
Hence to use
meta.openpkg.org
content on a website
http://www.example.com/ the URL
http://www.example.com/meta/ has to be transparently
proxied to
http://meta.openpkg.org/.
This is usually achieved by using Apache/mod_proxy and the
following two configuration directives in
apache.conf:
ProxyPass /meta/ http://meta.openpkg.org/
ProxyPassReverse /meta/ http://meta.openpkg.org/
Canvas Template Consumer Frontend
For convenience reasons, there exists a consumer PHP frontend script
meta.php
which can be used on the consumer website via PHP to easily use the
central canvas template transparently. For this, download and save
the script into the consumer's website document root.
Then configure the Apache 1.3 webserver to process
*.php files
with PHP 4.1.
Then you can create consumer pages which use
meta.php. See
sample.php
for a
sample consumer page.