Blog

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 } ?>
This entry was posted in Tips. Bookmark the permalink.

7 Responses to If Site is in Edit Mode, Display or Do This

  1. defunct says:

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

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

  2. defunct says:

    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 :(

  3. BASTA! says:

    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?

  4. defunct says:

    I wrote a little post on how I setup my theme to adjust backgrounds or anything really while the edit bar is being displayed.

    http://defunctlife.com/2010/06/concrete5-edit-bar-is-in-the-way-how-to-adjust-your-theme-in-edit-mode/

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>