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!

2 Comments

It's great to know these recaps are being posted in case we miss the meetings.

It would be super useful to revisit contexts as we didn't really get a chance to fully see all the ins and outs because the topic of panels is a large one if and of itself. But overall, I learned some new things, so it was totally worth the trip.

Thanks for the great writeup Jason. I think you explained it better than I did and thanks to everyone for showing up and listening. Since there appeared to be so much interest in Panels and the Omega theme, i'd be open to doing a more advanced thorough presentation of each of those topics if anyone would like that with real world application of these tools rather than just what they do. Andy

Add a comment

About the Author

Jason Yee

Developer

Jason joined the Aten team in early 2010 and has a long history of development in a variety of languages and technologies. Most recently, he's developed an affinity for Drupal development. Along with his passion for crafting great code, Jason is obsessed with all aspects of food and food science.

Read More Jason's Blog Posts
DrupalCon Denver 2012 - Gold Sponsor