Extension:AutoCategoryInclude

What can this extension do?
The extension looks for a category link on an article page, and includes the wikitext of a page matching the category name in Template namespace to the article wikitext. This is done for all the category links that have matching and existing pages in the Template namespace.

I coded this extension to be used with Semantic Mediawiki data. I use it to include info/factboxes with semantic data automatically to pages, and prevent the users from messing up the box template call or removing it while editing the article text. Thus, the template doesn't bring a lot of added functionality, and is meant to hide confusing and often messy looking wikisyntax from users and enable them to concentrate on the article contents instead.

The code was hacked together in one afternoon and as I don't have a very deep knowledge of Mediawiki nor the proper usage of hooks, the code might be unnecessarily complicated or use the API incorrectly. I'm glad if anyone is willing to develop and enhance it further.

Usage
Just create pages matching category names in the template namespace, they will automatically show on the article pages when the page is viewed.

Download instructions
Please cut and paste the code found below and place it in. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php: