You are here: Home Blog

Blog

Let's try this again. A whole bunch of years ago, I tried doing some blogging, and it didn't go so hot. Now, Core Software Group is doing a lot of exciting work with Plone, Django, Pyramid, and other Python based tools, and we are documenting various tips and tricks that we run into as we build custom solutions for our customers.

Aug 28, 2009

Migrating portal_status_message to addPortalMessage for Plone 3

by Chris Crownhart — last modified Aug 28, 2009 09:30 AM

Recently we did a large migration of a site with a high level of custom development. The old site was 2.0.5, and we migrated to 3.2.2. One of the coding changes we needed to make for the migration was fixing portal_status_message to use addPortalMessage.

This is a pretty simple change, but I could not find much documentation on it around the web.  We had quite a few controller python scripts that had code in them setting a portal_status_message.  The code looked like:

return state.set(portal_status_message='Your comment has been sent to the web support team.')

This old code is completely ignored now, so you have to convert these to the new format.

In Plone 3, portal_status_message is now handled using a cookie, and there are special classes and methods for adding your messages to the cookie.

Now, to set a status message, do the following:

from Products.CMFPlone import PloneMessageFactory as _
context.plone_utils.addPortalMessage(_(u'Your comment has been sent to the web support team.'))

Additionally, you can pass flags to the method to indicate:

  • 'info'
  • 'warning'
  • 'error'

like:

context.plone_utils.addPortalMessage(_(u'Your comment has been sent to the web support team.'), 'info')

For more information about the classes, interfaces, and methods, see this PLIP: http://plone.org/products/plone/roadmap/111

Aug 26, 2009

Simple way to add lightbox/thickbox support to Plone 3 site

by Chris Crownhart — last modified Aug 26, 2009 12:15 PM

I've been on a constant quest to find a simple way to add lightbox support to a Plone 3 site. Thanks to Products.pipbox, it is easy.

On the old Core Software Group site, I downloaded thickbox and manually added the css and js files to the portal_css and portal_js registries.  It worked, but was kind of kludgy.

Thanks to Steve McMahon's Products.pipbox, it's clean and easy, and gives you a massive amount of flexibility and control.  Here's all I did:

  1. Added Products.pipbox to my eggs section of my buildout.cfg, then ran bin/buildout
  2. Installed pipbox via quickinstaller
  3. pipbox adds a property sheet to portal_properties, which for now, you have to edit via the ZMI
  4. I added the following to /portal_properties/pipbox_properties -> selector specs:
    • {type:'overlay',subtype:'image',selector:'img.image-right,img.image-left,img.image-inline',  urlmatch:'/image_.+$',urlreplace:''}

  5. That's it.  Now our portfolio page uses the lightbox popups to display screenshots of Plone sites we have built.

Next up:

  1. Figure out how to control the position of the popup box.
  2. Figure out how to take advantage of AJAX form support in pipbox.
  3. Figure out how to implement AJAX tabs using pipbox.

Aug 15, 2009

Welcome to our new blog

by Chris Crownhart — last modified Aug 15, 2009 12:45 PM

Welcome. I hope we can provide some valuable information here for Plone users, content managers, and developers.

We at Core Software Group have been working with Zope for almost 10 years now, and with Plone for nearly 7 years!  Man, that is awesome!  I have always believed that Plone is the killer app for Zope, and have thoroughly enjoyed providing Plone consulting services.

During our journey down the Plone road, we have learned a ton, and it is my hope that we can share what we have learned in the past, and what we will learn in the future, on this blog, so other folks can benefit.

We have worked on Zope-only applications, built CMF-only applications, supported a variety of Plone versions, and most recently have been migrating old Plone sites to the newer Plone 3 platform.

There are an enormous amount of resources on the web for helping developers with Plone, but it always seems like the one thing you are working on does not have much documentation.  Additionally, there are just some things that require the "secret decoder ring"!

When we come across oddities that require you to pat your head and rub your belly at the same time to get Plone to work just right, we will tag them with "secret decoder ring".

I hope that we can provide useful information to other developers.  If you like what we've done, or have questions about what we can do, please feel free to contact us.

May 07, 2009

First Post :)

by Chris Crownhart — last modified May 07, 2009 03:35 PM
Filed Under:

Heh, heh.

Document Actions
 
 
Copyright © 2003-2017 Core Software Group | 303/809-1001 | Fort Collins, Colorado | All rights reserved.