If Site is in Edit Mode, Display or Do This

If you need to display or do something in your concrete5 theme when the site is in edit mode, use this code:

<?php global $c; if ($c->isEditMode()) { ?> Do something hereĀ <?php } ?>
Bookmark and Share

5 Comments

defunct  on June 25th, 2009

This didn’t work for me, here is an update function:

editingEnabled()) {
//Do something
}
?>

Chris Seymour  on June 26th, 2009

defunct-
what version of concrete5 are you running?

defunct  on July 11th, 2009

5.3.2 beta, but my function is also incorrect. That just checks if it can be edited, in which cause will not do the same thing :(

BASTA!  on February 14th, 2010

How to do it without relying on the global variable $c? Is there another way to obtain whatever $c is supposed to be set to?

Chris Seymour  on February 16th, 2010

@BASTA!
Not sure, what exactly are you trying to do?

Leave a Comment