Blocks

Application: 
OSU Drupal 6

 

Blocks are groups of content on a page that can be quickly turned on and off, moved around, and configured by users. Blocks are used, primarily, to establish the layout of a page.

blocks conceptual graphic

blocks conceptual graphic block in right sidebar

Some blocks are created automatically by some modules, such as a block that displays all new announcements, or one that displays menus. However, blocks can also be created manually to contain specific content of your choice, such as a feed from the OSU Event Calendar.

Announcement Block
summary announcement block

Menu Block
menu block

Custom Mini-Cal Block
custom mini-calendar block

Read on to learn more about basic block configuration and enabling.

Using the Blocks Manager

Application: 
OSU Drupal 6

 

The Blocks manager panel, which can be reached by going to Admin menu > Site building > Blocks, is the main control panel for all blocks. 

This panel can be very large and intimidating to new users, so we'll take some time to cover the main features of it.

blocks manager overview panel

regional areas depicted by yellow block areas on blocks manager

The Blocks manager has several yellow blocks scattered around the screen.  These indicate the different regions that are available for block placement.

theme tester tabs include all enabled themes

A series of tabs appears at the top of the panel with the names of all enabled themes on the site.  These tabs do not change the theme, they simply allow you to view the block layout when different themes are enabled.

enabled blocks section on blocks manager table

The table in the center of the Blocks manager contains two main sections: Enabled and Disabled.  Within the Enabled section are sub-sections that correspond with the yellow region indicators on the panel.  When you place a block within one of these sub-sections, it will show in the matching region when saved.

disabled region in blocks manager table

 

configure link highlighted

To configure a specific block, click on its configure link.  This will redirect you into that block's specific configuration panel.

General Block Configuration

Application: 
OSU Drupal 6

 

All blocks have some very basic configurations that can be used to customize either the title or the visibility of the block.  Following is an example of a basic block configuration panel.

General Block Configuration Components
basic block configuration panel components

General Configuration Options

  • Block title field
    • If nothing is entered in this field, the default title of the block, which is seen in the Blocks manager page, will be used.
    • A different name can be put in this field, if desired.
    • If no title is desired, enter <none>.  This must be entered exactly as shown with the <> around the word 'none' - all in lower case letters.
  • User specific visibility settings fieldset
    • This controls whether or not the user has any control over the display of the block.  If user-based block visibility is allowed, the controls for it are displayed on the user's account page.
  • Role specific visibility settings fieldset
    • This controls which roles are allowed to view the block.  If nothing is selected, then all roles, including anonymous users, will be able to view the block.
    • Please note that the visibility only relates to the block and the contents within the specific block.  It does not control access to the actual content that may be linked to the items within the block.
  • Page specific visibility settings fieldset
    • This controls where the block shows up in your site.  It's a very flexible tool.  The block can be set up to Show on every page except the listed pages, Show on only the listed pages, or Show based on some condition determined by the use of PHP code.
    • URL structure plays a big part in the success of this tool.  Using wildcards, blocks can be set up to show across entire ranges of content if the URL path is constructed logically.  For example, if you have a group of "people" content where the path starts with people/, such as people/john-doe, people/jane-foo, etc, you can set the block up to show on all nodes that have this URL structure by entering people* in the Pages fields.

Enhanced Block Configurations

Many blocks that are generated by the addition of modules to the system may have extra configuration options that you can set up for additional control over the display of a particular block. The Glossary:Random block is shown as an example below.  Note that it still has all of the general block configuration options, but it also has some additional ones at the top of the panel.  If there are blocks that have enhanced configurations, they will be detailed in their respective module sections within this book.

glossary:random enhanced block configuration panel

Create a Custom Block

Application: 
OSU Drupal 6

 

Custom blocks can be created, in addition to the default blocks that already exist in the system.

Custom blocks can contain all of the same content that the Body area of your nodes contain.  Keep in mind, though, that blocks that are placed into a narrow area, such as a sidebar, will require narrower content.  Digital assets such as images and video players will not automatically resize to fit in a narrower area so you must resize them accordingly or the item will spill over the edges of the block.

add block tab on block manager panel

There are a couple of different ways that you can add a block...

If you are not already within the Blocks manager, you can add a block directly from the Admin menu by going to Admin menu > Site building > Blocks.

If you are already in the Block manager, just click on the Add block tab at the top of the page.

Once inside the Add block panel you will note that it looks very similar to a node submission form in the fact that it has a Body field with a WYSIWYG toolbar and the Input Format fieldset.

The only real difference between a custom block and the default settings you see on something like a simple menu block is the presence of the Body field.  All other default block configurations, as described in the General Block Configuration section of this manual, are present.add block panel with block specific settings, body area for content and default block elements

Enable a Block

Application: 
OSU Drupal 6

 

Enabling a block simply means to "turn it on".  The way to turn on a block in Drupal is to place it in a region via the Blocks manager.

Note, if you will be configuring your block, it's best to do your configurations first, save them, and then enable the block.

To enable a block, just do the following:

Go to the Blocks manager at Admin menu > Site building > Blocks.

Locate the block you wish to enable in the Disabled list towards the bottom of the screen. In the corresponding drop-down menu, select the region in which you would like to place the block.  Once you select the region, it seems as if the block "disappears", but it's not gone - it just moves itself to the region you directed to move to when you made the selection.

drop down box for Primary links block with right sidebar region selected

If there are multiple blocks in the region and you want to adjust the order of the block in relation to the others, just grab the directional "handle" of your block and drag it up or down accordingly.

directional handle of block highlighted

Click the Save blocks button at the bottom of the screen.