Enable/Disable the administrator interface in specific paths


In the following code, the implementation of hook_admin_paths_alter() is shown to exclude or add the paths that we consider necessary or unnecessary to show with the administrative theme.

 * Implements hook_admin_paths_alter().
function hook_admin_paths_alter(&$paths) {
  // Paths declared FALSE will be outside the administration interface.
  $paths['node/*/edit'] = FALSE;
  // Paths declared true will show in the administration interface.
  $paths['custom/*/add'] = TRUE;

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.