August Denver Drupal Meetup Recap

Even with a number of Denver Drupal community members abroad at Drupalcon London, the August Denver Drupal meetup had a packed studio. After a round of introductions and sharing what we like about London and the UK (everything ranging from history, art and architecture to beer, second wave ska and pop culture), we launched into a presentation on Context and Panels.

##Introduction to Context and Panels

Andy began the presentation with a little background on the Context and Panels modules. Both modules are designed to let site builders customize what is displayed on the site based on a set of conditions or criteria. For Context this is done be creating a context, setting some conditions and setting reactions. Context conditions can be a number of things such as the URL path of the page being viewed, the role of the user viewing the page or the content type of the page being viewed. There are also a number of modules that extend Context conditions, such as Domain Context and Context Error. When a condition has been met, Context implements a reaction, which can be a predefined arrangement of blocks, a custom breadcrumb trail or a different site theme. Similar to conditions, there are also modules that extend Context reactions, such as the Context PHP module that allows you to run arbitrary PHP.

Similar to Context, Panels allows you to specify Selection Rules and Contexts as criteria that will determine if and when a panel is enabled. While Context allows block arrangement within a theme's regions as a reaction, Panels provides the ability to select from a number of layouts that extend or override a theme's regions. This makes it easier to customize pages by placing blocks in areas and arrangements that are not accessible within a theme's normal constraints. Panels also allows you to create "mini" panels - customizable, criteria enabled content that is available as blocks. This means that even if you don't need or use Panel's page layout functionality, you can use it to create finely controlled blocks for use in the standard Drupal block interface. And while Panels and Context are often seen as competing projects due to some of the overlap in functionality, with mini panels, it's easy to see how you could use the projects together.

One attendee asked if Views conflicted with Context and Panels. Views can use arguments or contextual filters to adjust the display of information based on some basic contextual criteria such as the page being viewed or the user viewing the page, but generally, Panels and Context complement Views. Views is oriented towards retrieving data, whereas Context and Panels are focussed on presenting data. To that end, Context and Panels can display Views plus much of the other data available in Drupal.

It's all Greek to me

Although Context natively lacks much of the layout abilities of Panels, that doesn't preclude it from being able to adjust design elements. The Omega theme is a responsive HTML5 based theme that uses Context to make the theme adapt to configurable conditions. Using the 960 grid and Context, a site builder can specify that under certain conditions, the Omega theme should adapt the layout to include or hide regions and adjust those regions to occupy a specific number of grid columns.

The Delta module extends Omega and other themes by creating theme variants. This allows you to create multiple theme "deltas" with unique configuration settings. You could then use context to select those "deltas" to present different theme configurations based on different conditions.

More resources

Panels is a hot topic and much of the open question and answer time related to the Panels portion of Andy's presentation. While there are many good resources about Panels available online, especially on Drupal.org, one of the best resources is Drupal's Building Blocks written by Earl Miles, the creator and project maintainer for Panels and Views.

As with many things in Drupal, good resources are often the experiences of other users, developers and site builders. We'd love to hear about your challenges and successes with Context and Panels, so leave a comment below. And as always, information about upcoming meetups can be found at the Colorado Drupal Groups page and we hope to see you at an upcoming meetup!

Drupal Drupal Planet Events