A Micro Micro CMS

Page ID

The file /inc/html.php sets a PHP variable: $pageID which contains a 'string' of text identical to the page title. As an example, for this page the string is page-id (the same as in the URL). It is specific to each page so can be used to script things to happen in that page alone, not all pages. The default theme colours page has a white navigation bar by activating an additional stylesheet 'navbar.css'. The $pageID 'colours' is added to /inc/stylesheets.php to activate 'navbar.css' only for that page:

if ($pageID == 'colours') {
  echo "\n";
  echo'<link rel="stylesheet" media="screen" href="' . LOCATION . 'css/navbar.css">';

$pageID is already used by the CMS in /inc/extra-content.php to make the 'extras' and comments page-specific. It is also used in /inc/extra-head.php to make Open Graph tags page-specific, and in /inc/top.php and /inc/menu.php.

These files will be able to access the $pageID in this load order:


If you are familiar with PHP scripting, by using:

if ($pageID == 'page-title') {

... you can add almost anything specific to the page page-title, or any other page, or even a set of pages:

if (($pageID == 'page-title') || ($pageID == 'another-page')) {


Information »

Page last modified: 22 December, 2020