Website Upgrade to D6 and Panels

Website Upgrade to D6 and Panels

Sat, 09/19/2009 - 12:28am

It's about freaking time!  As a professional web development shop, sometimes your website can suffer from the "cobbler's kids" effect, namely you're so busy working on other people's websites, that you haven't taken any time for your own.  I've been working to remedy that for a little while now, but I'm always up for trying something shiney and new, so... I decided to do it in the (fairly) newly released Panels 3 module. For those of you who have not yet tried Panels I can offer no stronger encouragement than to say it is the best thing since cck and views. I've not yet had the pleasure of exporting panels into their own module (think views export) but the maintenance possibilities here are very exciting.

I can tell you that the vast majority of the public facing portions of the site are built entirely in panels.  The front page is it's own special layout, as well as the internal pages.  Panels has made creating your own layout plugins incredibly simple (never mind the flexible layout that's included in core).  I've tried to donate back what knowledge I've gained as I've done this through a couple of patches (some documentation for panels, and the footer message page element for ctools).  It's sad to me to see panels show up so late in the D6 cycle, but despite that, it's so promising with the various features and powers it provides, this alone could revolutionize the way you build Drupal sites.  Panels has ACTUALLY simplified my theme.  The ability to represent the layouts I wanted within panels, without the need to build a page-front.tpl.php and a page-blog.tpl.php etc etc was really empowering.  I utilized Zen for this version of our look (which we'll be updating soon) and I actually simplified zen's default page tpl file by removing $title, $tabs, $footer_message and a few more things.  True, I had to re-configure these things within panels, but the simplicity of doing so, and the flexibility of the end product made it well worth the effort.

There were a number of SEO wins as well.  The primary win was that of node titles and h1/h2 issues.  There are a number of ways to solve this particular problem, but as I mentioned before, I removed title from the page tpl file in zen.  This is because panels allows me to override the individual node's title (with nothing in this case) and then have it displayed in the page title (h1) instead of the typical node title (h2).  This is great for singular nodes, again panels simplified any sort of alterations I might normally have made to my theme layer by just providing the options I wanted right out of the box.

The removal of tabs from the page tpl was an administrive aesthetic one.  I didn't want my tabs over the entire panel, I wanted them in with the content to which they pertained.  Again the panels tabs page element provided this right out of the box (you need to be running dev version of ctools to get more than one page element on screen at the same time).  In addition to this, I wanted my footer message as a page element, but it wasn't part of ctools plugins yet.  Merlinofchaos has made it very easy to add in new plugins of these types.  With just a little bit of work, I had my own footer_message plugin built very quickly. It worked exactly as I had hoped it would, and allowed me to build a great footer minipanel.

Minipanels really are a wonderful tool as well.  I built an additional layout style specifically for my minipanels so that I could utilize them with the most efficient markup possible.  Panels, by it's nature, adds a little bit of markup to whatever you may be doing layout wise, but most of this is helper markup for node edit links and things of that type.  Howere, if I know for certain that the content I'm dealing with is going to end up in a div of its own at the end of the day, having minimal (or no) markup surrounding it, but still having the ability to group it together is very powerful.  For the footer I built an "empty" layout, that was literally one region with no markup.  This meant that utilizing minipanels to build up grouping of content that would be the same from one page to the next made a great deal of sense.  With that in place, I built my footer once, and simply included it into the same region of the various panels again and again.

In all, panels is an amazing tool.  I will certainly be utilizing it more.  The new apis it provides are very empowering, and can simplify your maintenance needs pretty significantly.  If you haven't tried panels yet, I'd heavily encourage you to do so.

Share this

Our Web development team has developed thousands of websites for clients, both local and national.

We would love to help you in your business.

855.243.2035

Phone Icon

Contact Us

email icon