Question

Does anyone know the php code to check if you are in edit mode? I want to edit how my theme looks when in edit mode so need to work out if I am or not.

Was it helpful?

Solution

You can also make a page template to handle this. Check this from http://drupal.org/node/190815:

The list of suggested template files in order of specificity based on internal paths. One suggestion is made for every element of the current path, though numeric elements are not carried to subsequent suggestions. For example, "http://www.example.com/node/1/edit" would result in the following suggestions:

  1. page-node-edit.tpl.php
  2. page-node-1.tpl.php
  3. page-node.tpl.php
  4. page.tpl.php

OTHER TIPS

You can check url arguments as shown here.

if(arg(0) == 'node' && arg(2) == 'edit'){ /*...*/}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top