dev-master
9999999-devMaintenance plugin for Craft CMS
The Requires
- composer/installers ~1.0
- php >=5.3.0
Maintenance plugin for Craft CMS
, (*1)
The plugin provides tools to help you do maintenance on your Craft CMS website:, (*2)
The plugin is available on Packagist and can be installed using Composer. You can also download the [latest release][2] and copy the files into craft/plugins/maintenance/., (*3)
$ composer require carlcs/craft-maintenance
Set up maintenance announcements or messages from the pluginās settings page. You can use markdown to add links, or to format the message. To configure scheduled maintenance you have to set a start date in the announcementās settings and enable āBackend Maintenanceā and/or āFrontend Maintenanceā., (*4)
Create a new āMaintenance Announcementsā widget to display all notifications on the usersā Dashboards. Upcoming maintenance will also be announced with a banner notification., (*5)
When backend maintenance mode is active, users navigating the Control Panel will be shown a full screen āMaintenance in progressā overlay. It informs them about the undergoing maintenance, in order to prevent from useless data entry., (*6)
The frontend maintenance mode redirects all (frontend) requests to /503, your āservice unavailableā page. You can exclude URLs from being redirected and whitelist visitor IP addresses in the plugin settings., (*7)
Note: the plugin doesnāt do ācontent freezeā in a way, that it actually prevents data from being saved or changed in the database. That being said, there are template variables and plugins API provided., (*8)
The plugin can be configured from a craft/config/maintenance.php config file or from Settings/Maintenance., (*9)
In Settings/Users you can assign user permissions to configure the āMaintenance in progressā overlay or to grant access for individual user groups while frontend maintenance is carried out., (*10)
The plugin provides template variables to get the active announcement model, or to check whether the site is currently undergoing maintenance., (*11)
isCpMaintenance
Returns whether the Control Panel is currently undergoing maintenance., (*12)
{{ isCpMaintenance ? 'Shop closed' : '<a href="/shop">Shop</a>' }}
isSiteMaintenance
Returns whether the site is currently undergoing maintenance., (*13)
{% set reason = isSiteMaintenance ? 'scheduled' : 'unscheduled' %}
getAnnouncement( timeInAdvance )
Returns the latest, either currently active or soon to be activated maintenance announcement., (*14)
{% set announcement = craft.maintenance.getAnnouncement('2 hours') %} {% if announcement and announcement.blockSite %} <span>{{ announcement.message }}</span> {% endif %}
Maintenance plugin for Craft CMS