8
Home
Jonathan Miller edited this page 2026-05-21 22:23:27 -05:00

<-- Back to Repository

MokoJoomTOS

A Joomla system plugin that keeps your Terms of Service, Privacy Policy, or any legal page accessible to visitors -- even when the site is in offline (maintenance) mode.

Field Value
Author Moko Consulting
License GPL-3.0-or-later
Platform Gitea
Version 04.01.00
Joomla 5.x / 6.x
PHP 8.1+

Why MokoJoomTOS?

When you put a Joomla site into offline mode for maintenance, every page returns the offline message -- including legal pages that may need to remain publicly accessible. Many jurisdictions require Terms of Service and Privacy Policy pages to be available at all times. MokoJoomTOS solves this by selectively bypassing offline mode for configured URL slugs, rendering only the article content without any site template chrome.

Features

  • Offline-mode bypass -- Keeps designated pages accessible while the rest of the site shows the offline message
  • Multiple slug support -- Configure one or more menu item slugs to expose during offline mode
  • Component-only rendering -- Strips headers, footers, navigation, and modules for a minimal, secure view
  • Child-path matching -- A slug of legal also matches /legal/privacy, /legal/terms, etc.
  • Zero database footprint -- No custom tables; uses native Joomla content and menu infrastructure
  • Auto-provisioning installer -- On first install, automatically creates a sample article, "Legal" menu type, menu item, and enables the plugin
  • Idempotent installation -- Safe to reinstall; checks for existing resources before creating duplicates
  • Update server ready -- Manifest supports Joomla update notifications via Gitea-hosted updates.xml with stability channels (stable, rc, beta, alpha, dev)
  • Joomla 4+ namespaced architecture -- Uses SubscriberInterface, PSR-4 namespacing, and a service provider
  • Multilingual support -- Language files included for en-GB and en-US (site and admin)

How It Works

The plugin subscribes to the onAfterRoute Joomla event. When a request comes in:

  1. Check scope -- Only acts on the site application (not admin)
  2. Check offline -- Only acts when the site is in offline mode
  3. Match slug -- Compares the URI path against each configured tos_slug parameter
  4. Bypass offline -- If matched, temporarily sets offline = 0 for this request only (not persisted to database)
  5. Strip template -- Forces tmpl=component so only the article content renders (no header, footer, or modules)

If the URL does not match any configured slug, the plugin does nothing and visitors see the normal offline page.

For full technical details, see How It Works.


Guides

Page Description
Installation Step-by-step guide to installing the plugin from release or source
Configuration Plugin parameters, slug setup, and limitations

Documentation

Page Description
How It Works Technical architecture, event flow, URL matching, and security details
Update Server How updates.xml is managed with stability channels and moko-platform CLI

Quick Start

  1. Download the latest ZIP from Releases
  2. Install via System > Install > Extensions in Joomla admin
  3. The plugin auto-provisions everything -- no configuration needed
  4. Set your site offline and visit /terms-of-service to verify

Requirements

Requirement Minimum
Joomla 5.0 or later
PHP 8.1 or later
Database None required (uses native Joomla tables)

Plugin Architecture

src/
├── mokojoomtos.php            # Legacy entry point (loads namespace)
├── mokojoomtos.xml            # Plugin manifest (params, files, update server)
├── script.php                 # Installation script (auto-creates article + menu)
├── services/
│   └── provider.php           # Joomla service provider (DI container)
├── src/
│   ├── Extension/
│   │   └── MokoJoomTOS.php    # Main plugin class (event handler)
│   └── Field/
│       └── MenuslugField.php  # Custom form field for slug selection
├── language/                  # Site-side translations (en-GB, en-US)
└── administrator/
    └── language/              # Admin-side translations (en-GB, en-US)

moko-platform


Repo: MokoJoomTOS . moko-platform

Revision Date Author Description
3.0 2026-05-21 Moko Consulting Update to 04.01.00, multi-slug support, service provider, stability channels
2.0 2026-05-10 Moko Consulting Rewrite with features, architecture, and quick start
1.0 2026-05-09 Moko Consulting Initial version

End-User Documentation

This wiki is for developers and contributors. For end-user guides (installation, configuration, usage), see the Knowledge Base:

MokoWaaS Platform Support Articles