As you know, So many Content Managment Systems Have a “Maintenance Mode” i think you Know What this is!, so why can not invent something even for Kirby?. There is something like this
or that is unnecessary?
Then add a new invisible page called maintenance with a text file called maintenance.txt and a maintenance.php template. Add the text you want to display when in maintenance mode. Alternatively, you can use a router to achieve the same.
Then in your header snippet add this:
<?php if($site->maintenance()->isTrue() and $page->uid() != 'maintenance') { go('maintenance');} ?>
WOW it works!, aber es soll Ja so Funktionieren das man die ganze seite nicht mehr sehen kann, mit einer Nachricht “Wir sind gerade nicht Erreichbar”, wie mach ich das
Wenn “Enable Maintenance” wahr ist, wird jede Seite (außer der Maintenance Seite selbst) zu Maintenance weitergeleitet. Alles was jetzt noch fehlt, ist ein bisschen Inhalt in der maintenance.txt Datei, z.B.
title: Wartungsmodus
----
text: Diese Seite wird gerade gewartet. Wir sind bald wieder da.
Du kannst im Maintenance template auch ein header snippet ohne Menü benutzen bzw. das Menü nur anzeigen, wenn die Page UID nicht “maintenance” ist.
Depending on what work/actions you consider to be maintenance using Kirby to set up this page could be problematic. For example if you switch to maintenance-mode to upload a Kirby update (via FTP) which takes some time (slow internet connection or whatever) and when the visitor comes to the page a relevant part of the Kirby for could be inaccessible because of the FTP transfer sync.
To make a long story short: I’m using a plain index.html file showing the maintenance message while updating. My server is configured (as most other serves) to prefer index.html over index.php (the latter is the one starting the Kirby magic). After updating I rename index.html to maintenance.html to “disable” maintenance mode.
@tobiasweh You have a point there, but your solution can’t be done from the Kirby panel and @simondev was asking for a way to integrate a maintenance mode into Kirby.
If you use Git to deploy your site, you don’t have this sort of delay and would not need a maintenance mode for the few seconds it takes to update your site.