Theme files

A theme file is a zip file that contains a theme manifest and all the images, CSS and JavaScript files. Once uploaded into Metrici, it can be used directly as a theme. It is the most secure, reliable and convenient way of distributing themes.

The zip file contains:

  • A file called manifest.xml in the top level of the theme. See Theme XML reference for a decription of the syntax. If you are converting from a node-based theme, you should be able to copy the theme manifest, and just change the locations in the <content> elements.
  • Optionally, a 360x360 pixel png file called preview.png in the top level of the theme which contains a preview of your theme.
  • The images, CSS and JavaScript that your theme requires, in any structure.

Within the manifest, you can refer to the other files in your zip file using the following placeholders:

  • ${rootPath} – as normal
  • ${themeResources} – this evaluates to ${rootPath}resources/reference/, where reference is the node version reference of the theme file, and is effectively the root directory of your zip file. If, for example, you have a css file in the zip file directory mytheme/mytheme.css, you can refer to it in a <content> element using

    <link rel="STYLESHEET" href="${themeResources}mytheme/mytheme.css"/>

Once you have created your zip file, simply upload it to Metrici using the File (library.file.UserFileType) type. It also makes sense to add Theme (library.tags.ThemeTag) to the tag list for the file.