Core /

Templating

Boxary uses template driven rendering:

there is a strict separation between the code and the rendering.

In short this means that there is no html inside the code.

The templates are organised around three aspects: permission, mode and appType:

 editviewlist
 C.G.AC.G.AC.G.A
adminx.x.xx.x.xx.x.x
private.x.x.x.x.x.x
public. ..x.x. .x
Any valid combination does exploit its own set of templates. They depend on the App used: being crude, graph, groves.
Crude
the template set for edit/view/list functions are different for each canvas and for each vertex/edge. Find them in ./templates/@<canvas>/crude.
If a specific vertex/edge template is 'missing' for edit/view, Boxary falls back to _default.thtml in the respective directories.
Graph
every vertex/edge has too its own directory. When directories are 'missing' a fallback to the default directory is implemented. Find them in ./templates/@<canvas>/graph.
App
the template set for admin/private/public can be different. Find them in ./templates/admin, ./templates/private, ./templates/public.
When templates are 'missing' a fallback is implemented: admin -> private -> public.
The templated content can be categorized as
* Property snippets,
* Attribute snippets,
* Slot templets,
* Grove templets,
* Aggregate templates,
* Application templates.
And application templates can be categorised as
* permission based, as in public, private, admin
* crude triggered, as in list, edit, view
* entities, based on the ontonomy (binder)
* categories, based on the taxonomy (trait)
* widgets, as in filter, whatsnew, .....


Templates are organised in a hierarchy: snippet -> templet -> template

Snippets are single line strings and used for properties, attributes and some slots. See the manifests.
Templets are external files and processed as either templates, either closures. See ./patterns.
Templates are external files and contain if-then-else logic. See ./templates.
tRoot = .../plugins/boxary/templates and can be configured.

Templates based on permissions are found in tRoot/public, tRoot/private and tRoot/admin. Crude functions are triggered by templates in these directories. Their names start with '_' (underscore); like _editor, _viewer and _list.
Crude functions however, may use node based templates to render the properties of these nodes (vertex, edge). These templates reside in tRoot/@canvas/#<crude>.

Apps will use templates for known entities and/or known categories. These are centralised in tRoot/@canvas/public where each node has its own directory. Some apps can gather semantic content from complex ontonomy / taxonomy queries, like a graph structure. These templates are found in ./patterns/groves. Basic rendering of slots use closures found in ./patterns/slots

Finally, the manifests contain snippets with template functionality.

  • patterns
    • /groves
    • /slots
  • templates
    • /@canvas
      • /public
        • /default
        • /<binder>
      • /_editor
      • /_viewer
      • /_list
    • /admin
    • /private
    • /public
    • /filter
    • /whatsnew