Site under maintenance

I would like to set a flag in a collection that the site is under maintenance. But I have no clue where to put the code. I would prefer to have it in a global function (or on Site-page) so I don´t have to implement it on every page. Anyone?

You can set up to() function on “site” section.
Like this:

import wixLocation from 'wix-location';
$w.onReady(function () {

	wixLocation.to("/mait");	

});

I tried, and it worked for me… With such code, trying to open any page leads me to “mait” page

1 Like

Thank you. That also answered my next question: if you had to do the $w.onLoad also on site level.