5

does anyone know if there is a flag, accessible at template level, that indicates whether the "System Status" lightswitch in Settings -> General menu is on or off? (I'm thinking something similar to craft.config.devMode)

I tried craft.config.isSystemOn but it did not work since the setting is not defined in the general.php config but rather via the user interface.

Just to give some context, I'd like to add extra items to the template for logged in admin users to see on the website only when system status is set to off (like a warning bar).

Thanks in advance! Daniel

8

You could use craft.app.isSystemOn. This will return 1 if the System Status is "on" in Settings -> General in the control panel. It will also respect the value of the isSystemOn config setting if you're setting it in general.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.