Blocks

A block is a Drupal container object, and is the primary tool you'll use to organize your website's content.

You can use blocks to hold content or website functions (such as the log in fields), and you position them on your website by placing them inside of regions.

The marked parts of this page are all blocks:

Blocks

Block types

There are several different types of blocks that you can use to develop your website:

  • Standard and system blocks - Many blocks are already available on your site. Some of them are dynamic (i.e. "Recent comments", "Recent blog posts") or special system blocks ("Drupal Gardens login", "Search"). All Drupal menus are generated as blocks.
  • Static or embedded content - Text, HTML, images, maps or other embedded material from the web.
  • Dynamic content - Modules and features such as Views, Media Gallery, and others create blocks.

Enabling some modules makes more blocks available. Check the Blocks page at Structure > Blocks to see what blocks you have available on your site at any given time.

Creating blocks

Use the following procedures to create the blocks that you need for your website.

Static blocks

To create a block with static content:

  1. Go to Structure > Blocks, and then click the Add block link.
  2. Enter the following values for each of the fields on the Blocks page:
    • Block description - Block label displayed on the Block administration page.
    • Block title - Block label displayed to site visitors after you place the block in a region.
    • Block body - Enter the information displayed by the block using Drupal Gardens' built-in WYSIWYG text editor. You can also disable rich-text entry and enter HTML directly.
    • Region - Set the block region where the block should appear on your site. You can also set this directly on the main Blocks administration page.
  3. At the bottom of the page, use the Visibility settings panels to set additional block options:
    • Pages - Set which pages the block should or should not be displayed on.
    • Content types - Show this block only on pages that display content of the given type(s). If you don't select any content types, the block will be shown on all pages that meet your other display condition regardless of content type.
    • Roles - Show this block only to users with the selected role(s). If you don't select any roles, the block will be visible to all users.
    • Users - Set whether users can set this block's visibility on their user account page.
  4. Click Save block.

Dynamic blocks

Blocks displaying content mash-ups and previews can be created using Simple views. After you create a view with a block display, go to the Block page at Structure > Blocks to enable it by placing it in a region.

Performance considerations

Displaying a large number of blocks on your website at one time can affect how quickly it returns pages for site visitors. Additional blocks increase the amount of time it takes to generate results.

Managing blocks

As content and structure change on your website, you must be able to move blocks that contain content to different pages and locations on your website, as well as disable blocks you no longer need.

Moving or placing blocks

To move a block to another region for display:

  1. Go to Structure > Blocks.
  2. Find the block that you want to move.
  3. Select a different region from the block's Region drop-down menu.
  4. Click Save blocks.

Hiding or disabling blocks

To hide or disable a block that you no longer require:

  1. Go to Structure > Blocks.
  2. Find the block that you want to hide.
  3. Select - None - from the block's Region drop-down menu.
  4. Click Save blocks.

User menu block.png

Feedback