CI4MS Engineering

Theme Development Guide

Welcome to the CI4MS Theme Development Guide. This documentation will walk you through the process of building a custom theme for the CMS/ERP hybrid system.

1. Folder Structure

A standardized CI4MS theme (e.g., starter) spans across app/ and public/ directories:

2. The info.xml Ecosystem

Before activating your theme, ensure info.xml is present in your public/templates/{themeSlug}/ folder.

<?xml version="1.0" encoding="UTF-8" ?>
<theme>
    <name>Starter Theme</name>
    <slug>starter</slug> <!-- Must match your folder names logically -->
    <author>Your Identity</author>
    <screenshotPNG>starter/screenshot.png</screenshotPNG>
    <version>1.0.0</version>
    <description>Your theme specification</description>
</theme>

3. Getting Started: base.php

The core structural file is app/Views/templates/{themeSlug}/base.php. It serves as the master HTML layout.

CRITICAL: The module renderer will automatically parse and output the main response to a variable named $content. You must echo $content inside the body element.
Example snippet:

<main>
    <?= $content ?? '' ?>
</main>

Available Core Variables in base.php:

4. How Routing Works

If you define custom routes in app/Config/templates/starter/Routes.php, they will take precedence matching before the catch-all dynamic URL handlers in CI4MS. Thus, any post logic (/form-submit) should be registered here instead of core routes.

Begin Building Instantly

Download our fully structured Starter Theme Package or explore the architecture further.