Community Documentation

Blocks in Drupal 6

Last updated November 9, 2009. Created by rkdeveloper on April 25, 2008.
Edited by LeeHunter, JohnNoc, dellintosh, add1sun. Log in to edit this page.

Blocks contain content from modules, or custom content input by the administrator.

Adding a new block

  1. From the Blocks overview page (Administration > Site Building > Blocks), click the "Add Block" tab.
  2. Insert a Block description (*required), which will be displayed on the block overview page.
  3. Insert a Title for the block.
  4. Insert the body content for the block. Be sure to confirm you are using the correct input format for your block.
  5. (optional) Set User, Role, and Page specific visibility settings.
  6. When you click save, the block is created but not placed in a region by default. You will need to drag and drop it into a region in order for it to show up on the site.

Configuring a block

  1. Go to the Blocks overview page (Administration > Site Building > Blocks) to configure the blocks on your site.
  2. This page allows you to drag-and-drop blocks into different regions as well as reorder the blocks within a region.
  3. Next to each block you can click "Configure" to change the specific block settings:
    • Block title: Allows you to override the default title for the block
    • User, Role, and Page specific visibility: Adjust visibility for block based on user, role or page.
    • Additional settings may also be available, depending on the particular block.

Note that blocks are configured per theme. If you change the theme or enable multiple themes, you will need to configure blocks per theme.

Deleting a block

You can only delete a block added through the method above. Blocks created by a module can not be deleted using this method.

  1. On the Block overview page (Administration > Site Building > Blocks), blocks that can be deleted will have a "delete" link beside them. Clicking this link will present a confirmation page, and clicking the Delete button will remove the block.

Third-party videos

Comments

Show right block depending on screen resolution

Surprisingly I haven't seen it mentioned anywhere and since it's not clear where to put this, I've chosen this "block information page"
What code is needed in the "Show if the following PHP code returns TRUE (PHP-mode, experts only)." section for blocks if I only want to show the block if screen resolution > 1024
Obviously with the intention to show rightcolumn blocks only if the screen is wide enough.
I find it strange that no-one asks for this and that all the supposed solutions only say "ow... you need javascript for that" or work with the ever-boring "alert: hello world" example, but not ever a simple copy and paste solution for these 10 or 12 lines (how much can it be?) that would make a website so much more versatil (and Drupal too....)

I started with Drupal in 2007 and then my life got stuck...

Have a look in the theming section

For anyone interested the answers are related to the Drupal theming subject.

This remark is not so much block related but more a theming issue. You could easily define additional regions in your theme and have these regions become visible on wider screens or create special wider themes for wider screens. (And yes it involves javascript to inform the server side what client side screen width is used).

Joel Box - Mondial-IT