Problem with mustache template

Re:

by Stephen Sharpe -
Number of replies: 0

Hi Kieran

This is a very long overdue reply but it appears you have something missing from your template. The original error message:

This template has no example context, so it cannot be rendered here. To add an example context to this template, insert in a Mustache comment "Example context (json):", followed by the json encoded sample context for the template.

The above error message explains the need for "Example context (json):" but it doesn't indicate that you also need to enter both the name of the plugin and the name of the template. For example - "@template theme_boost/admin_setting_tabs" above the json context. So for example:

{{!
    @template theme_boost/admin_setting_tabs

    Example context (json):
    {
        "tabs": [
         {
            "name": "tab1",
            "active": 0,
            "displayname": "Inactive tab1",
            "html": "<p>Tab 1 content</p>"
         },
         {
            "name": "tab2",
            "active": 1,
            "displayname": "Active tab2",
            "html": "<p>Tab 2 content</p>"
         }
        ]
    }
}}

Hopefully this helps you or someone else struggling to get example content to appear for mustache templates.

Thanks!
Stephen