jQuery

New in Panels 2: Mini Panels and Panel Styles

A couple of weeks ago, I agreed to work on the Panels Mini module, which would become part of the second version of Earl Miles' outstanding Panels module. While working on that, I suggested to let modules implement styles for panels. (I was inspired by Nedjo Rogers' Panelsblock module, which sort of gives you "tabbed Mini Panels" for Panels 1). All you then would have to do, is: pick the Panel Style in the settings for the Mini Panel (or whatever other Panels implementation chooses to support it) and then change the CSS to get exactly what you want. This should prove to be a real timesaver.

More about Panel Styles

I've written 2 Panel Styles so far: Carousel Panel Style and Tabs Panel Style. The latter might be included in Panels 2. Both were sponsored by Paul Ektov.
To write a Panel Style, you only have to implement 2 hooks, or 4 hooks if you want to offer configuration options. Hopefully that will result in many contributed Panel Styles!

hook_panels_panel_style_info()
returns an array of Panel Styles that the module implements, along with some metadata
hook_panels_panel_style_render()
receives the Panel Style configuration and an array of (rendered) panes, returns the rendered HTML
hook_panels_panel_style_settings_form()
(optional) defines a form if your Panel Style supports some configuration options
hook_panels_panel_style_settings_validate()
(optional) validation function for the form of the previous hook

(Fancy?) Demo

Without further ado, a fairly fancy demo of all this.

I want this yummy stuff too! Where can I get it?

Mini Panels and the Panel Styles hooks are available in the Panels 2 CVS, and will be included in Panels 2 alpha 8 when it gets released. Be warned that Panels 2 is still a work in progress!

Syndicate content