Manual:SkinMustache.php/th

The SkinMustache class allows skin developers the flexibility to display the underlying data however they chose. A Mustache template is associated with the skin to be rendered and receives template data as described below.

To explore this more see Manual:How to make a MediaWiki skin.

Template data
All data referenced here can be explored using the SkinJSON skin.

The Mustache skin associated with a skin receives the following data:

Menus (aka portlets/portals)
For backward compatibility there are several types of Menus to be aware of when rendering in SkinMustache. It is hoped in future a standardized menu format will be used for all.

PortletData
Menus (aka portlets/portals) in SkinMustache have a consistent data structure that looks like follows:

DataPortletsObject
The data-portlets object allows access to all the different menus that are available to render. Menus are organized into different buckets. A skin developer can choose to render each of these separately, to modify these buckets via the SkinTemplateNavigation::Universal hook, or omit them. Each menu contains data consistent with data-portlets-sidebar.

DataHtmlObject
When dealing with this type, you are expected to create a container with id and class as attributes and html as its inner HTML. The container may contain other elements if you wish. The primary reason for the existence of this type, is you may want to render certain items as lists (`li` element) or blocks (`div` elements).

DataLogos
Note this data structure can be extended by extensions, and site configuration in LocalSettings.php

LogoObject
Note this data structure can be extended by extensions, and site configuration in LocalSettings.php