Community Documentation

Custom blocks

Last updated August 12, 2005. Created by puregin on May 3, 2005.
Edited by Uwe Hermann. Log in to edit this page.

A custom block contains content supplied by you (as opposed to being generated by a module). Custom content may be either static (i.e., HTML) or dynamic (PHP generated content). Virtually all of the functionality of Drupal is accessible from within a PHP content block. The flexibility of blocks provides an extremely powerful way to customize your Drupal website.

You can create a custom block via the block management screen (click on administer » blocks). Select the new tab and complete the form.

Each custom block has a title, a description, and a body. The content within the body can be as long as you wish.

Note: In Drupal 4.6, the title of the block is used as its identifier in the database table. Therefore you can only have one custom block without a title (this issue has been fixed in newer Drupal versions).

One workaround for this is to enter a title such as this: <!--title of custom block-->. This satisfies Drupal's need for a block title but the comment markers (<!-- ... -->) prevent it from being displayed.

Archive

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here