Clone
5
Configuration
Jonathan Miller edited this page 2026-05-21 22:23:27 -05:00

← Back to Home

Configuration

MokoJoomTOS has a minimal configuration surface -- one parameter controls which pages remain accessible during offline mode.

Plugin Parameters

Access the plugin settings at System > Plugins > MokoJoomTOS (search for "mokojoomtos"):

Parameter Type Default Required Description
Terms of Service Menu Slug (tos_slug) Custom menuslug field terms-of-service Yes One or more menu item aliases that should remain accessible when the site is offline

The MenuSlug Field

The tos_slug parameter uses a custom form field type (MenuslugField.php) that presents a multi-select dropdown of all published menu items in the system. This field is registered via the manifest XML:

<fields name="params" addfieldprefix="Joomla\Plugin\System\MokoJoomTOS\Field">
    <fieldset name="basic" label="PLG_SYSTEM_MOKOJOOMTOS_FIELDSET_BASIC">
        <field
            name="tos_slug"
            type="menuslug"
            label="PLG_SYSTEM_MOKOJOOMTOS_FIELD_TOS_SLUG_LABEL"
            description="PLG_SYSTEM_MOKOJOOMTOS_FIELD_TOS_SLUG_DESC"
            multiple="true"
        />
    </fieldset>
</fields>

Multiple Slug Selection

As of version 04.01.00, the field supports multiple="true", allowing you to select several menu items. Each selected slug (and its child paths) will be accessible during offline mode.

For example, selecting both terms-of-service and privacy-policy means:

  • /terms-of-service -- accessible
  • /terms-of-service/section-1 -- accessible (child path)
  • /privacy-policy -- accessible
  • /about-us -- blocked (offline page shown)

Changing the Slug

To protect a different page (e.g., a Privacy Policy):

  1. Create your article in Content > Articles
  2. Create a menu item with your desired alias (e.g., privacy-policy)
  3. Go to System > Plugins > MokoJoomTOS
  4. Select your menu item(s) from the dropdown
  5. Save

The plugin matches the URL path against each configured slug. Child paths are also matched -- if the slug is legal, then /legal/privacy would also be accessible.

Language Strings

All labels and descriptions are translatable. Language files are included for both en-GB and en-US:

File Location Purpose
Site language language/en-GB/plg_system_mokojoomtos.ini Labels, descriptions, error messages
Admin language administrator/language/en-GB/plg_system_mokojoomtos.ini Admin panel labels and help text
Admin system administrator/language/en-GB/plg_system_mokojoomtos.sys.ini Plugin name shown in extension manager

Key language strings:

Key Purpose
PLG_SYSTEM_MOKOJOOMTOS_FIELD_TOS_SLUG_LABEL Slug field label
PLG_SYSTEM_MOKOJOOMTOS_FIELD_TOS_SLUG_DESC Slug field description/help
PLG_SYSTEM_MOKOJOOMTOS_ERROR_LOADING_MENU_ITEMS Error message when slug dropdown fails to load

How Offline Mode Works with Configuration

When a visitor requests a URL while the site is offline, the plugin:

  1. Checks if the site application is in offline mode ($config->get('offline'))
  2. Reads the tos_slug parameter from plugin settings
  3. Compares the current URI path against each configured slug
  4. If matched: temporarily sets offline = 0 for that request only and forces tmpl=component
  5. If not matched: does nothing (Joomla shows the normal offline page)

The tmpl=component setting strips the full site template, showing only the article content. This minimizes the attack surface during maintenance mode.

Limitations

  • The field shows all published menu items across all menu types
  • Child-path matching is prefix-based -- a slug of terms would also match /terms-and-conditions


Repo: MokoJoomTOS · moko-platform

Revision Date Author Description
3.0 2026-05-21 Moko Consulting Update for multiple slug support, remove single-slug limitation
2.0 2026-05-16 Moko Consulting Add language key reference table
1.0 2026-05-09 Moko Consulting Initial version