Monday, January 11, 2010

Code for side bar left in drupal

The following places the blocks designated for the left 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-left).

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

No comments: