Community Documentation

How to: create a quick admin block

Last updated November 10, 2009. Created by jbrauer on January 21, 2008.
Edited by LeeHunter, Chris Johnson, MissyM. Log in to edit this page.

An administration block can be a helpful tool for developing sites. This is a recipe for creating a block with links to common administrative tasks.

Create New Block:

www.example.com/admin/build/block/add

Give it a title and add this to the body

<a href="/admin/build/database">Database</a>
<a href="/admin/content/types">Content Types</a>
<a href="/admin/content/node">Content</a>
<a href="/admin/content/backup_migrate">Backup</a>
<a href="/admin/build/modules">Modules</a>
<a href="/admin/build/block">Blocks</a>
<a href="/admin/build/views">Views</a>

Select Full HTML as input type. Place the block on the page through the block administration interface. When the block is no longer necessary it can be disabled in the block administration interface.

Alternative method
There are several modules that provide access to administrative functions. The following block code, which requires the 'PHP' input filter manages situations where the Drupal installation is not at the root level of the webserver.

<?php
$url
= $GLOBALS['base_url'];
$links = array(
   
"Database" => "/admin/build/database",
   
"Content Types" => "/admin/content/types",
   
"Content" => "/admin/content",
   
"Backup" => "/admin/content/backup_migrate",
   
"Modules" => "/admin/build/modules",
   
"Blocks" => "/admin/build/block",
   
"Views" => "/admin/build/views"
   
);

foreach(
$links as $title => $path)
{
    echo
'<a href="' . $url . $path . '">' . $title . '</a><br >';
}
?>