Overlaying features like in-line drag n drop and color adjustment to Panels module

One of the more enjoyable tasks I've had with Drupal in the last few months is figuring out a way to give the power of panels to our kid users without all the ... well, power. Our code is currently bundled as a custom (not quite releasable) module. I think some of the ideas that came out of the process might be valuable, so I'm sharing a little screencast demo. This custom module layers the following features onto the Panels module:

  1. The ability to add, remove, and re-order blocks directly on a panels page. The Panels module requires you to use a powerful (but complex) edit page to do this.
  2. The ability to restrict blocks to particular columns / regions. We needed to restrict the placement of blocks in order to keep the page layout clean. Our module adds a config page to select which blocks are available for each column in a 3-column layout.
  3. The ability to save per-panel settings. Because we wanted each panels page to have different features like colors and background images, we needed a way to associate a panel pane (which is a block added to a panels page, for example) with particular settings. Our module includes a panel settings table to store these.
  4. We also created a block that allows a use to change different colors on a page, or upload a background image.

I learned a lot of fun jQuery stuff building this module out, and finally ran into Internet Explorer's css file limit (my head is still a little bloody after that one).

Comments

Item #3 is silly. Panels already has that. They're called styles. You can have a style on a pane, panel region or the whole display.

You're right, in this example the css could be stored in the styles input. For other pane-specific variables, there's not similarly corresponding fields. Say, for example selecting a specific imagecache preset for a block of thumbnails, or for saving arbitrary text to display in an area of the block, or selecting from a pre-set group of polls. Even in this case of colors, it is useful to have key / value pairs to work with, since each color change affects several different styles on the page, and to read those styles back into a key / value pair structure would take some crufty regex. In many cases, you could probably use an embedded view for this and pass it arguments, but being able to set any kind of variable for and kind of pane-embedded block is a useful feature for non-view-based blocks.

Post new comment

The content of this field is kept private and will not be shown publicly.