« June 2008 | Main | September 2008 »

August 11, 2008

Overriding portlets -- common stumbling blocks

Skinner's tip #2
------------

It's dumb, and it happens to me constantly, but there are a few things I occasionally forget when trying to override a portlet:

1) If you get an error like this:

File "/opt/zope/buildouts/otis/src/plonetheme.mytheme/plonetheme/mytheme/browser/configure.zcml", line 51.1, unbound prefix

Add the xmlns:plone="http://namespaces.plone.org/plone" namespace to the top of your browser/configure.zcml file.

2) Before your portlet override code, make sure you add this snippet:

‹include package="plone.app.portlets" /›

3) Watch your path back to plone.app.portlets.portlets (note the double mention of portlets). You're walking through a folder structure, and portlets are nested a little deeper than viewlets. As for the "navigation" bit in the portlet= assignment below, that refers to navigation.py (a file, not a folder), and INavigationPortlet is an interface defined in that file.

‹plone:portletRenderer
portlet="plone.app.portlets.portlets.navigation.INavigationPortlet"
template="navigation.pt"
layer=".interfaces.IThemeSpecific"
/›

4) Note also that we're using the portletRenderer directive for overriding portlets, rather than the portlet directive that you find in existing (Plone default) portlets.

August 10, 2008

Blogging About Theming - At Last

I've fortunate to have some fairly vocal coworkers blogging about the inner workings of ONE/Northwest and how we fit into the Plone story. Lately, though, I've come to the conclusion that themers are a fairly quiet group of people in the Plone community, and I'd like to see that change. My goal is to post a loose, ongoing set of thoughts around "what I learned today in theming" in the hopes it might help someone else. Be gentle, as I am not the smartest, geekiest person out there. :)

Today: beware of using the wrong version of Subversion. I recently got a new IMac, and in setting up my development environment, I grabbed Subversion 1.5. This isn't a bad thing in itself -- the problem is that our svn repository uses 1.4, and it took me several hours to back down to 1.4 before I could start making checkins again. A rather unfortunate experience, given that we had a high priority project that had to roll out. Lesson learned, 2 years added to my life.

Don't forget to check out the Weblion blog that explains how you can get around some Python ugliness involving Subversion 1.5 (in the event that you do indeed have the right version of svn on your own repo): http://weblion.psu.edu/news/subversion-1.5-has-landed

- Veda