5.7 and static pages like maintenance for instance

Permalink
Hi guys!

First of all, 5.7 seems like a really good step going forward.

I'm taking it for a spin and trying some of the basic stuff and one thing I can't understand is how can you change the template and style for static pages like maintenance mode ?

I can't both override the view or, as it seems possible, override the full page on my own custom template...

Any hints?

Thanks,

View Replies:
Willough replied on at Permalink Reply
+1.

I too would like to customize the maintenance mode page in 5.7.
c5hub replied on at Permalink Reply
c5hub
You can override pages such as login, register etc by following this guide:

https://www.concrete5.org/documentation/developers/5.7/designing-for...

However testing this, for some reason Maintenance Mode does not work...
a575606 replied on at Permalink Reply
+1 to this
nkennel replied on at Permalink Reply
nkennel
I tried to override the maintenance mode view by creating /application/views/frontend/maintenance_mode.php, but it did not work. I ended up editing the view directly in the concrete directory. It will get overridden someday but I don't care because I don't use it much. Perhaps someone else knows how to override views?

I found the view in /concrete/views/frontend/maintenance_mode.php

If it helps anyone, the view gets called from /concrete/src/Routing/DispatcherRouteCallback.php and looks like this:

// maintenance mode
        if ($c->getCollectionPath() != '/login') {
            $smm = Config::get('concrete.maintenance_mode');
            if ($smm == 1 && !PermissionKey::getByHandle('view_in_maintenance_mode')->validate() && ($_SERVER['REQUEST_METHOD'] != 'POST' || Loader::helper('validation/token')->validate() == false)) {
                $v = new View('/frontend/maintenance_mode');
                $v->setViewTheme(VIEW_CORE_THEME);
                return $this->sendResponse($v);
            }
        }
nkennel replied on at Permalink Reply
nkennel
I tried to override the maintenance mode view by creating /application/views/frontend/maintenance_mode.php, but it did not work. I ended up editing the view directly in the concrete directory. It will get overridden someday but I don't care because I don't use it much. Perhaps someone else knows how to override views?

I found the view in /concrete/views/frontend/maintenance_mode.php

If it helps anyone, the view gets called from /concrete/src/Routing/DispatcherRouteCallback.php and looks like this:

// maintenance mode
        if ($c->getCollectionPath() != '/login') {
            $smm = Config::get('concrete.maintenance_mode');
            if ($smm == 1 && !PermissionKey::getByHandle('view_in_maintenance_mode')->validate() && ($_SERVER['REQUEST_METHOD'] != 'POST' || Loader::helper('validation/token')->validate() == false)) {
                $v = new View('/frontend/maintenance_mode');
                $v->setViewTheme(VIEW_CORE_THEME);
                return $this->sendResponse($v);
            }
        }
trmwebdesign replied on at Permalink Reply
trmwebdesign
nkennel, you were on the right track - the override does work, but you must ensure you clear your Concrete cache.
This worked for me:
I downloaded a copy of /concrete/views/frontend/maintenance_mode.php, customised it and uploaded it to /application/views/frontend/maintenance_mode.php.
I then cleared the cache and voila!
nkennel replied on at Permalink Reply
nkennel
Perfect! Thanks trmwebdesign, I'll give that a shot next time.