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.
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:
- page-node-edit.tpl.php
- page-node-1.tpl.php
- page-node.tpl.php
- page.tpl.php
You can check url arguments as shown here.
if(arg(0) == 'node' && arg(2) == 'edit'){ /*...*/}
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:
- page-node-edit.tpl.php
- page-node-1.tpl.php
- page-node.tpl.php
- page.tpl.php
© 2022 - 2024 — McMap. All rights reserved.