Embedding simple PHP scripts in Midgard

cover image for Embedding simple PHP scripts in Midgard

MidCOM, the PHP framework for Midgard CMS has over hundred components for various purposes ranging from blogging to waste management statistics. But even with all of them it is sometimes useful to embed some custom PHP scripts to a site. The old method of doing this was using a custom style for a folder and including PHP files there, which was a bit awkward.

As Arttu mentioned, Asgard, Midgard’s new administrative interface has been receiving a lot of love recently. This has mostly focused on centralizing features strewn across the MidCOM environment to a single interface: attachment handling, version control, component configuration, …

Another change made yesterday was making the "nullcomponent", the fallback component used by MidCOM in case a folder doesn’t have a component assigned more useful.

Now you can configure it to execute code stored in the folder:


Then just edit the code:


And it will be executed in the folder:

Nullcomponent-Phpinfo<p style="text-align:right;font-size:10px;">Technorati Tags: asgard, midcom, midgard</p>

Read more Midgard posts.