Pages

Pages are reusable views used to build out sections of an HMI. Pages are defined in the tmplits.json file, and are referenced using the value assigned to “name.” Because Pages are made of Partials, they can be parameterized as a template but most Pages are not.

tmplits.json

{
    ...
    "pages": [
        //This section defines the views 
        //  "name" is how it is referenced as a Partial.
        //  "file" is path to the .handlebars file.
        //  When used, the entire file is added to the DOM
        {
            "name": "mainView",
            "file": "../views/main.handlebars"
        },
        ...
    ],
    ...
}

../views/main.handlebars

{{! I can include standard html }}
<div>Hello World</div>

{{! I can also include other partials }}
{{> cncControl}}

An example of using mainView in another Page:

{{> mainView}}

That line will be replaced with the contents of mainView (../views/main.handlebars), so the output HTML is as follows:

<div>Hello World</div>

<div>My Cnc Controller is defined somewhere else</div>