Last updated November 8, 2008. Created by Jody Lynn on May 3, 2005.
Edited by chx, kbahey, Bèr Kessels, puregin. Log in to edit this page.

This section presents a collection of custom blocks submitted by Drupal users.

You can study how the preinstalled Drupal blocks work by searching the associated module files for the string "_block". All blocks defined in a module begin with hook_block.

Have a look to see what is put into $blocks["subject"] and $blocks["content"]. The login-block, for example, is implemented in the user module's user_block() function as block 0 ("case 0:" - this delta is there because the user module defines more that one block).

More examples of PHP code snippets can be found in the page snippets section.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

being able to browse snippets by version number would be really useful

(especially as there's quite a lot of them)

Some useful Drupal Teaser and Title snippets for those looking to build lists of content types.