Creating a One Off Page with Mustache - tooltwist/documentation GitHub Wiki
A Word of Warning
This procedure should be used only in special cases, as every page created this way will have to be maintained separately. For example, if you have a hundred pages with a similar layout, it is tempting to use the process described here and just cut and paste code to make them all look the same. In this case, if you ever wish to change the header you will need to update all one hundred pages, one at a time.
By preference, you should create the pages of your website using [page templates](Creating a Template for Pages using Mustache), so that the common parts of the pages are defined once in the template rather than in each individual page. In the example above, this would allow all hundred pages to be updated by simply changing the template.
Creating a Custom Page
This is a simple process.
-
Create a regular Mustache widget, in the _pages folder.
-
Convert the widget into a page by editing
conf.xml
and modifying the widgetClass definition.<widgetClass>tooltwist.wbd.MustachePageWidget</widgetClass>
-
Reload the widget definition using the Misc->Reload Cache menu option.
The widget should then be able to be used as a page and referenced from a Navpoint.
From here, you should add the standard page variables for headers, footers, etc, as described in Creating a Template for Pages using Mustache.