admin theme switcher snippet for your page.tpl.php file

description

This snippet automatically switches your theme to a custom page-admin.tpl.php layout file so a custom administrators theme is activated when needed.

Useful if you're using a fixed-width site design and your administration pages breaks the layout.

usage

  1. Make a copy of your page.tpl.php file and rename it to page-admin.tpl.php.
  2. Using a text editor like notepad.exe or equivalent, copy the preferred snippet and place it at the very top of your page.tpl.php file.
  3. Edit your page-admin.tpl.php layout file
  4. Upload your new page-admin.tpl.php layout file and your edited page.tpl.php file to your active theme folder

<?php

/**
* This snippet tells Drupal to load up a different page-admin.tpl.php layout
* files automatically. For use in a page.tpl.php file.
*
* This works with Drupal 4.5,  Drupal 4.6 and Drupal 4.7
*/

if  (arg(0) == 'admin' ||
(
arg(0) == 'node' && arg(1) == 'add') ||
(
arg(0) == 'node' && arg(2) == 'edit') ||
(
arg(0) == 'user' && arg(2) == 'edit')) {
    include
'page-admin.tpl.php'; /*load a custom page-admin.tpl.php */
   
return; }
?>

 
 

Drupal is a registered trademark of Dries Buytaert.