Managing blocks

Two very important concepts in Drupal are blocks and regions. Blocks are small boxes of content that surround the main page text. Menus, icons, search boxes, certain views and more are often shown inside blocks. In turn, blocks are grouped together into regions: larger areas of the page where blocks are placed.

Note that PeaceWorks sets up blocks for you according to the layout of the graphic design we agreed upon. Be aware that rearranging blocks will change the layout of the site and will cause it to look different from the graphic design.

Viewing regions on your site

Before arranging blocks, it's good to know where you can put them.

To view a demonstration of all the regions on your site:

  1. From the black bar at the top of the site, click Structure.
  2. Click Blocks.
  3. Click Demonstrate block regions in the help text at the top of the page. You will go to a page where all blocks are hidden and every region is highlighted in yellow.
  4. When you're done, click the Exit block region demonstration overlay at the top-left corner of the page.

Note: you may notice new areas of the page you've never seen before appear. Most commonly, you'll see another sidebar which previously had nothing in it. Do not be alarmed: Drupal is designed to be flexible and hide things that aren't being used. In other words, if you don't put any blocks in that new sidebar, it won't appear anywhere else.

Arranging blocks

Once you have an idea of where each region is, you can move blocks around as you desire.

Note: changes to blocks take effect immediately. If you're testing out a new layout for your site, we recommend trying it on your staging site first (PeaceWorks provides a staging site with every website we make) or during off-hours.

Note: there's nothing stopping you from moving or disabling the menus that your visitors use to navigate around the site. You can't break the black bar at the top of the screen, but moving menus around can be confusing to visitors at best, and stop them from getting to other parts of your site at worst.

Note: blocks are supposed to be able to work wherever you put them, but certain blocks (drop-down menus in particular) are designed to fit in regions of a certain shape. Moving them to a differently-shaped region may make it difficult for people to use.

To rearrange blocks:

  1. From the black bar at the top of the site, click Structure.
  2. Click Blocks.You will see a table with region groups and blocks in those regions.
  3. Drag–and–drop blocks in or between regions.
  • The Disabled region is special: putting a block here will hide it completely.
  • To quickly place a block in another region, choose the new region from the drop-down list.
  • Click Save blocks to save your changes.
  • Changing the title of a block

    You can change the title of any block. To do this:

    1. From the black bar at the top of the site, click Structure.
    2. Click Blocks.
    3. Click configure next to a block.Note: if you've been rearranging blocks, you should click save blocks before doing this... clicking configure will discard your changes!
    4. Enter or change the Block title.If you don't want to display a block title at all, enter "<none>".
    5. Click Save block.

    Custom blocks

    Drupal supports adding custom blocks. You might use this feature to display an image to let visitors know about a special event or to show an important announcement. Drupal lets you write a block in the same way you edit a page, although blocks don't have revisions or special fields.

    To add a custom block:

    1. From the black bar at the top of the site, click Structure.
    2. Click Blocks.
    3. Click Add block above the table.A page similar to the content form will appear.
    4. Enter a Block title. The user will see this at the top of the block.If you don't want to display a block title at all, enter "<none>".
    5. Enter a Block description. This will be the title of the row on the block administration page. Only content administrators will see this.
    6. Enter a Block body with the body editor.
    7. Optionally, under Region settings, set which region you want the block to show up in. If you don't set one, the block will start out in the disabled region and you will have to drag it into place.
    8. Click Save block.

    Note: custom blocks show up with a delete link on the block administration page.

    Change a block's visibility

    Sometimes, you will want a block to be in a region, but only appear under certain conditions. For example, perhaps you want to display a list of recent blog posts only when someone is viewing another blog post.

    Any block can be given a set of display conditions. To do this:

    1. From the black bar at the top of the site, click Structure.
    2. Click Blocks.
    3. Click configure next to a block.Note: if you've been rearranging blocks, you should click save blocks before doing this... clicking configure will discard your changes!
    4. Scroll down to the Visibility settings section. You have the following options:
      1. Pages: show or hide the block based on the address of the page being viewed.The special text "<front>" means "the front page (homepage) of the website".You can set a block to show on all pages except a few (blacklist) or only on certain pages (whitelist) but not both. If you have more-advanced requirements, talk to PeaceWorks.
      2. Content types: show the block based on the type of page being viewed.
      3. Roles: show the block based on which user roles a viewer has.Note: this does not allow you to create pages hidden from search engines and the general public. If you want this functionality, talk to PeaceWorks.
      4. Users: allow people who have an account on the site to choose whether or not they want to see the block.