Drupal theme code for development if you are editing node

Does anyone know the PHP code to check if you are in edit mode? I want to edit how my theme looks when I need to work in editing mode if I have one or not.

+4
source share
2 answers

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

A list of suggested template files in order of certainty based on internal paths. One proposal was made for each element of the current path, although numerical elements were not brought to subsequent sentences. For example, " http://www.example.com/node/1/edit " will result in the following sentence:

  • PAGE- node -edit.tpl.php
  • PAGE- node -1.tpl.php
  • PAGE- node.tpl.php
  • page.tpl.php
+1
source

You can check url arguments as shown here .

if(arg(0) == 'node' && arg(2) == 'edit'){ /*...*/} 
+10
source

Source: https://habr.com/ru/post/1307647/


All Articles