Blocks

A block is content that can be displayed on all the webpages throughout the website. Typical examples are 'Recent Blog Posts', and the Navigation menu. Drupal generates blocks when certain modules are enabled, you can make a block yourself also. The content of a block can be anything, like text, a list of clickable links, even a picture.

Once created you can decide on what pages you display the block, what the position should be and what kind of users will see it.

Don't forget to set the permissions (Administer>>User management>>Permissions and look under block module) so that administer blocks is enabled for you

The Block-page

You do all the block-management on the block-page (Administer>>Site building>>blocks). Here an example of part of the block-page in the Garland-theme.

Notice 'Header' on top, one of the regions you can put a block in the Garland-theme

Adding a block

You make a block by going first to the tab Add block, on top of the page. An overview of the different fields you fill in:

  • Block description: Name of the block
  • Block title: The title as shown to the user. If you don't want the title to be shown, fill in <none>
  • Block body: This is where you put the content, like when you write a page, story or blogpost. HTML is possible. If you enabled a text-editor like FCKeditor, you can use it here to create your content.
  • Custom visibility settings: If users can decide wether or not they see the block. If they can decide, the choice can be made under 'My Account', after they logged in.
  • Show blocks for specific roles: You have the choice here to what user-role you'll display the block. If a user has any of the roles you choose to display the block at, the block will be displayed to that user.
  • Show blocks on specific pages: You have the possibilty here to use wildcards. The wildcards are displayed in the explanation underneath, at the block-page.

Configuring blocks

When going to the List-tab and you have several themes enabled, you can choose for what theme you configure the blocks for. Every theme has its own regions where you can put a block, these regions are indicated on the block-page. To put a block in a certain position you can make a choice in the little window on the block, or drag the block in the list to the name of the region. You also can drag the block to the position inside the region. Don't forget to hit save after you reordered blocks.

You can change a lot of settings when you click on configure, next to every block. You normally can't change the Block body of predefined blocks (a block that is generated by a module). You only are able to delete blocks you made yourself. If you just want not to display a block (without deleting it) then choose <none> in the window where you can choose its position.

Go back to 'Building a Drupal site'

Share/Save