Panels 3.7 Views Context - quick demo

Apart from the Panels In-Place Editor, the greatest news in Panels 3.7 is (imho) the Views Context. It allows some cool stuff on the surface, but mindblowing possibilities if you look deeper. Here's a quick demo of what Views Context is!

Ok, so you've used Panels for a while and gotten used to managing contexts. Here's a new challenge for you: Views as context.

What's the point?

Point number one is that Panels can output individual elements from a view loaded as a context. This is most interesting when outputting stuff like row 1, 3 and 5 in one pane and row 2, 4 and 6 in another. And – yes – you can choose which fields from the view to output.

Point number two is just so much cooler. You can add an object from the view as a new context. This means that you can pick out the topmost node and display some extra information about that, without having to resort to strange hacks and view calls inside custom-written mini-modules.

What really sends my brain spinning is what you can do if you don't restrict point number two to nodes. Get a list of taxonomy terms as a View context, and send back hit 1 and 2 to fetch articles in the two most popular tags for the current post. Or make a list of newest articles, and call different variants of the panel depending on settings in the first hit. And so on. The View context isn't about embedding views into panels, but to provide Panels with a query tool.

DISCLAIMER: Every Wednesday (or so) someone at NodeOne makes an unprestigious presentation about something related to Drupal. The presentation is mainly for internal use, but we have decided to share recordings of the presentations to anyone interested. They are shared as-is – there screencast is uncut, sometimes interrupted, can contain noises and bad sound capture. They can also contain useful information about Drupal.