admin theme switcher snippet for your page.tpl.php file
Task · ARCHIVE · How to switch theme to custom layout · Site users · Themers · Drupal 4.5.x or older · Drupal 4.6.x · Drupal 4.7.x
Last modified: August 25, 2009 - 02:58
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
- Make a copy of your page.tpl.php file and rename it to page-admin.tpl.php.
- 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.
- Edit your page-admin.tpl.php layout file
- 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; }
?>