Building a Drupal Website With Blocks

In Drupal development, you might want to add custom content to different areas of your site to frame the content on the different pages. You can do this by using blocks: boxes of content that can be displayed in different regions (such as the footer and sidebar) of each page on your site.

Blocks provide the same flexibility with functionality as editing a page. Enabling modules is the most common way to make blocks available on your site. Once a block is created, you can edit its appearance, shape, size, position and select the pages of your site you want the block to appear on in your Drupal development project. Blocks can show on several pages or one page. This can be useful if you need to add content to a page that only a specific user role has permission to see. Enabling certain modules will provide custom blocks that you can insert into the pages of your site. It’s also worth noting that while some modules provide multiple blocks when enabled, others may not define new blocks in Drupal development.

Your site’s theme defines the regions available to place blocks in Drupal development. This means that block placement in regions is done per theme on the Block Admin page. Blocks can be placed differently for each theme if you have more than one theme enabled on your site. Placing blocks on your site pages can be done on the block management page.

The block management page lets you specify the vertical sort-order of the blocks within each theme region. In Drupal 6+ this can be done by dragging and dropping blocks to the desired position. You can also do this by assigning a weight to each block. Lighter blocks (smaller weight such as -50) “float up” towards the top of the region, while heavier blocks (+50) “sink down” towards the bottom of the region of your Drupal development.