There are situations where you have to know if the user is currently editing the page. For example, the in-site editing toolbar sometimes causes problems because it shifts down a few elements. If your layout has been built using absolutely positioned layers, you probably have to move down the layers a bit in case the toolbar is visible.
The current page object can be accessed by using the variable $c
, which contains a method that returns true if the page is currently in the edit mode. The following code will output a short sentence, but only if the page is in the edit mode. You can put the following little bit of code in default.php
again or any other template you like:
<?php if ($c->isEditMode()) { echo 'You are editing this page at the moment!'; } $b = new Area('Main'); $b->display($c); ?>