Overlaying features like in-line drag n drop and color adjustment to Panels module
Created on May 11, 2009, last updated 1 year ago
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:
- 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.
- 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.
- 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.
- 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).
Recent blog entries
Twitter feed:
- Any tips on where to get the word on on a press release like this? http://is.gd/dR9hC #fb3 hours ago
- Press release for the "Save Joseph" campaign http://is.gd/dR9hC #fb3 hours ago
- Added bounty for the person with the lead that lands Joseph a job. Only 1 week left in the Save Joseph campaign! http://is.gd/dKybt #fb3 hours ago
- @aplusk A friend suggested you might be able to help me. Any tips on getting the word out about this: http://savejoseph.org? Thanks!15 hours ago
- @rvtctweat The scrolling module was Views Infinite Scroll http://drupal.org/project/views_infinite_scroll16 hours ago
- 8 more days to help me find a job for an amazing artist before CERTAIN DEATH! Please send ideas! http://savejoseph.org #fb1 day ago
- How to use images for menu items in Drupal with a simple preprocessing function http://is.gd/dOXc71 day ago
- The campaign to find a kick-ass artist a job is on Twitter. Follow if you believe in the cause! http://is.gd/dMwHq #fb2 days ago
- @pcambra Thanks, I'm glad you're liking them! Cheers!2 days ago
- How to create an image based dynamic countdown timer with Imagecache http://is.gd/dKHnR2 days ago
Topics
- activism
- apple software
- book reviews
- design
- Drupal
- drupal administration
- drupal community
- drupal events
- drupal modules
- drupal resources
- freaky stuff
- geeky entertainment
- iphone ipod touch
- jquery
- learning
- life hacks
- looping
- maps
- minimalism
- music
- philosophology
- presentations
- productivity
- rambling
- restraint
- software
- theming
- treadmill desk
- usability
- usability testing
- video demonstrations
- web hosting
- original songs
- This American Life
- evernote
Blog archive
- March 2009 (2)
- April 2009 (15)
- May 2009 (10)
- June 2009 (3)
- July 2009 (3)
- August 2009 (6)
- September 2009 (2)
- October 2009 (4)
- November 2009 (3)
- December 2009 (1)
- January 2010 (1)
- March 2010 (1)
- June 2010 (1)
- July 2010 (43)










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