Creating reusable styles for Midgard

Midgard 1.7 alpha release is now under work, and will ship the Midgard Site Wizard with a new default way for creating websites. The Site Wizard enables developers to create layout templates that can be reused and customized when creating new websites.

When a user runs the Site Wizard to create a new website, they will be presented with a list of installed style templates together with their screenshots and descriptions. When they select a style, a child style will be created into their sitegroup to allow modifications, and the site will be set to use it.

The style template can also allow itself to be configured by using a datamanager schema. This way the template designer can let users to change the colors of the template and upload their own images into it.

Here’s a quick HOWTO on making templates:

  1. Create the template as a new style named template_Stylename
  2. Add your credits to the template using parameter named midgard.admin.sitewizard/template_credits
  3. Add a short description of the template using parameter named midgard.admin.sitewizard/template_description
  4. If you want to include a screenshot with the template, add it as an attachment to the style as a 130 pixel wide JPEG with name __preview.jpg

After this your style should appear in the “Select style” dialog of the site wizard:

Style list in the Site Wizard

Updated 2005-10-24: It is also a good idea to add the Display/Shared, YES parameter for at least some Aegir compatibility.

Read more Midgard posts.