As a convenience for template and content authoring, Gizmo(QP) provides
the gtinfo() template callable. Calling this from within a
a template will display a nicely formatted listing of the currently
executing template namespace, including all site-specific and, if any,
all page-specific customizations.
The sub-namespaces
kw
All keyword arguments passed on the call to page() show up
under this sub-namespace. Cleared and updated per hit.
On globals.
page
Callables that concern the page.
This is initialized when the Gizmo(QP) Directory is initialized,
and is used by all pages of the directory. The two values
page.title and page.content are specially treated,
as they are updated per request.
On locals.
site
This is made up mostly of renderers or utilities that pertain
to the site, provided by the site’s skin.
On globals.
dhi
This is the dhi instance for the
page. Note that this is not necessarily the dhi instance
for the hit. This allows to access page-specific data, as it is
accumulated during a response. Particularly useful is the ability to
access any existing
gizmo object
i.e. via dhi.gizmos.gizmoid.
On globals.
gizmo
The module gz.skin.gizmo,
exposing selected gizmo objects.
On globals.
html
The module gz.skin.html,
exposing various html utilities.
On globals.
hit
This is the current QP Hit instance, thus giving
access to the curent request, response
and session objects.
On globals.
begin.* end.*
Open-ended sub-namespaces.
A template may define as many
begin.indicator and/or end.indicator
as necessary, to delineate
the beginning and/or the end of a template.
Thus marked, a template may be GTi-addressed.
If evaluated, these always evaluate to the empty string.
On globals.
Customizing the evaluation namespace
Site-wide customization is done by adding values or callables
to any of the sub-namespaces that are set via the Evaluator’s globals
dictionary. This is most conveniently done in the __init__()
of a subclass of any of the Skin classes.
Directory-specific customization is done by adding values or callables
to the page sub-namespace — best done by modifying
the directory’s locals dictionary in the directory’s __init__().
Page-specific customization is done by passing arbitrary keyword
arguments to the page() delegator function, that will appear
under the kw sub-namespace.
Calling gtinfo()
To call it, just add the following code to the template:
That, for this page, produces:
gizmo(qp) template namespace
}]