Easier handling of CSS with MidCOM

The Midgard style templating system was designed back when site layouts were still mostly in-line HTML tables. As such this caused some problems with the new standards-based school of web design, as there it is desirable to place the layouts into separate, linked style sheets.

The obvious solution to this was to make Midgard's style elements URL-addressable. I made first commit adding this feature to midcom-template last week.

MidCOM site template now serves elements from the site style under /style subdirectory. For security reasons the elements must have a parameter midcom/allow_serve set to true. If the element names have a .css or .js suffix the system will also set correct mime types for them automatically.

This way it is easy to serve as many linked CSS or JavaScript files as needed from the Midgard style system. Here's how it looks like in Aegir's style manager:


Next up will be supporting Flash cross domain policy files in /crossdomain.xml if set. These are often needed in web campaign setups where Flash front-end and Midgard back-end reside on different servers.

Oh, and according to the latest blog meme:

Privateers, privately owned vessels licensed by government to attack enemy commerce, seized the mails, held them for ransom and robbed them of any gold or silver they contained.

From Conquerors of Time by Trevor Fishlock.

Read more Midgard posts.