Open Source Content Management System

Modifying MidCOM component output

  1. Default style elements
  2. Overriding the templates
  3. Examples

MidCOM components use a style engine for all their output, meaning that site builders can easily modify all component output by simply overriding templates.

Default style elements

MidCOM components ship a set of default templates that are stored in the style subdirectory of the component.

The template files are regular PHP files that are executed in their own context.

Example: Templates of de.linkm.newsticker in CVS

Overriding the templates

You can override any output template of a component by logging into Aegir and creating a new substyle under your site's style. It is a good idea to name the substyles according to their use, like Photo gallery or Blog.

Then copy the style template that you want to override from the component and create a style element with the same name (but trailing .php removed) under your new substyle and paste the contents there. Make some change and save it.

Then log into your site, go to AIS and click Edit Topic. In the editor you'll have a pulldown for selecting a Style. Select your new substyle.

Then simply go to the site and see how the changes have taken effect.

If your site uses output caching, you might have to access the /midcom-cache-invalidate URL first.

Examples

Designed by Nemein, hosted by Anykey