Check If concrete5 Site Is in Edit Mode

Published on November 13, 2012 by

Sometimes you may wish to check whether or not your site is currently in edit mode. This can easily be done with the simple code below.

global $c;

if ($c->isEditMode()) {
	// Site is in edit mode
} else {
	// Site is not in edit mode
}

The global $c gives access to the collection object.

Author avatar
Bo Andersen

About the Author

I am a back-end web developer with a passion for open source technologies. I have been a PHP developer for many years, and also have experience with Java and Spring Framework. I currently work full time as a lead developer. Apart from that, I also spend time on making online courses, so be sure to check those out!

One comment on »Check If concrete5 Site Is in Edit Mode«

  1. handoyo

    Hi,thanks for the snippet.Do you know what event was triggered by the edit button in the admin toolbar and what code does it related to?Thanks

Leave a Reply

Your e-mail address will not be published.