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 global variable $c
, which contains a method that returns true
if the page is currently in edit mode.
Open
default.php
of your theme or any other page type template.Look for the code
new Area
and right before it, insert the highlighted lines as shown here:<?php if ($c->isEditMode()) { echo 'You are editing this page at the moment!'; } $b = new Area('Main'); $b->display($c); ?>