Add 'online' value for Mustache template
Provide an 'online' value to the Search Result Mustache template. This will, for example, allow you to put things in your Search Result template that will show up when your site is displayed live (PHP), but will not be output when your site is displayed using the offline Javascript, and vice versa. eg. {{#online}} This will only display in your template if it's online. {{/online}} {{^online}} This will only display in your template it it's offline. {{/online}}
This commit is contained in:
parent
042339d3ef
commit
47562e0a71
|
@ -80,8 +80,12 @@ function os_return_all() {
|
|||
|
||||
// Create the Mustache template
|
||||
let os_TEMPLATE = {
|
||||
errors: false,
|
||||
|
||||
online: false,
|
||||
version: '{{version}}',
|
||||
searchable: false,
|
||||
|
||||
addError: function(text) {
|
||||
if (!this.errors) {
|
||||
this.errors = {};
|
||||
|
|
|
@ -59,6 +59,8 @@ foreach ($_RDATA['s_latin'] as $char => $latin) {
|
|||
// {{{{{ Initialize the Mustache templating engine
|
||||
class OS_Mustache {
|
||||
public $errors;
|
||||
|
||||
public $online = true;
|
||||
public $version;
|
||||
public $searchable;
|
||||
|
||||
|
|
Loading…
Reference in a new issue