Mecha CMS

Add extra functionality to the core engine.

Layout

Table of Contents
  1. Features 
  2. Classes 

Common automation function used to speed up site development.

Mecha does not have the capability to change themes through configuration files, and therefore there will only be one theme on every website built with Mecha. As with the site’s interface language, themes are one of the things that website owners rarely change within a daily or monthly period. So, Mecha decided to remove such features.

Layout files are stored in the .\lot\layout folder. To change the default theme with another theme, remove all files from that folder and then put your custom theme files there.

.\
└── lot\
    └── layout\
        ├── 404.php
        ├── page.php
        └── pages.php

Features 

  • Detect asset path relative to the .\lot\asset and .\lot\layout\asset folder.
  • Detect layout path relative to the .\lot\layout folder.
  • Add HTML classes automatically to the <html> element based on the current page conditional statements.

Classes 

These HTML classes will be added to the <html> element as long as it has a class attribute:

  • error:404 → Will be added if there is no page or pages to load.
  • has:next → Will be added if it is possible to go to the next page.
  • has:page → Will be added if there is a page to load.
  • has:pages → Will be added if there are pages to load.
  • has:parent → Will be added if current page has parent page.
  • has:prev → Will be added if it is possible to go to the previous page.
  • has:step → Will be added if page URL contains the page offset.
  • is:error → Will be added if there is no page or pages to load.
  • is:home → Will be added on home page view.
  • is:page → Will be added on single page view.
  • is:pages → Will be added on multiple page view.