Monday, January 11, 2010

Code for side bar right in Drupal.

This snippet places the blocks designated for the right region into a table cell. Note the conditional statement; this allows the output to be hidden in the event that no blocks are assigned to the region. For styling, the table cell (td) is given an id name to reflect the placement (sidebar-right).

if ($show_blocks && !empty($blocks_right)) {
$output .= " <td id=\"sidebar-right\">$blocks_right</td>\n";
}

No comments: