Kastalia Knowledge Management System · Glasperlenspiel template · knot 426

Templates and views

🌐 public · created AE530127 (27.01.2023) · by DDH · open in the standard editor view · 📽 open as presentation

A template is the piece of code that decides how a given knot (and, typically, its neighbours in the graph) gets turned into an actual page a human can read. Kastalia uses Template::Toolkit (Perl's TT) for this: each template is a .tt file living under views/, free to query the graph however it needs and to render the result however it likes.

The same knot can, in principle, be rendered by several different templates -- a lecture knot might look like a slide deck under mainframe, a flat document under knot (the default), or a node in a force-directed diagram under arbre. Which template applies is usually decided by the knot's own template attribute, though some domains additionally define a fixed canonical template that every .knot-style URL on that domain gets routed through regardless (see domain_template in config.yml).

The resulting rendered page is called a view.

Ancestors (1 superordinated path)