Gallery3:Block Management UX - Gallery Codex
Personal tools

Gallery3:Block Management UX

From Gallery Codex

Blocks are generic content containers within template regions. The following outlines block administration options and user experience. The Trac ticket for this spec is Allow define sorting and visibility of the sidebar blocks.


Key Concepts

Sources: Blocks are provided either by Gallery modules or by site administrators as static HTML via a text input.

Placement: Blocks may be placed within any theme-defined template region, including sidebars, headers, footers, and the main content area. Module developers may determine default placement, i.e. sidebar, header, etc. Themes define their available regions through their theme.info file.

Visibility: Blocks are visible by default but can be removed template regions to remove their visibility. Block visibility may also be set per view. This means a block, for example, might be set to display on album pages but not on photo pages.

Ordering: The block admin. page allows site admins to drag and drop blocks to change display order within template regions.

Permissions: Only site administrators may manage blocks. Initially, there will be no configurable view permissions for blocks. A block, if placed in a theme region, is visible to all unless the block's module specifies otherwise. Theme developers may place blocks within a template and apply logic to determine visibility based on user credentials.


Template Region Definition in Themes

Template regions as defined in a theme's theme.info file. The region is set to either true (1) or false (0). Beginning with version 6, Drupal simply defines sidebars as either left or right.

The default theme's regions.

regions: header,footer,content,right

Two sidebars, one on each side of the content region.

regions: header,footer,content,left,right

Two sidebars on the right of the content region.

regions: header,footer,content,right,right2


Block Admin User Interface

Place, order, and remove blocks within template regions

Site admins drag and drop available blocks to template regions. They then can rearrange blocks within regions through drag and drop. The 'x' button removes a block from a region returning it to the available block list. The edit button opens an edit dialog for the block.


Editing block settings

The edit button opens a dialog for the block. Module's provide available block settings. A simple textarea is displayed to add/edit HTML source for custom blocks.


Setting block visibility in views

A matrix of checkboxes provides site admins with block visibility control for each defined view. Not shown is an option to create custom, wildcard compatible visibility rules.