Rick Hurst Web Developer in Bristol, UK

Menu

Category: plone

OK, it’s time to categorise my blog posts

this is the internet equivalent of trying to organise my CD collection – wait- that’s not too difficult, i’m giving most of my cd’s to a charity shop as I prefer digital only these days. I think my “readers” are getting a bit confused when I jump between posts about coffee and posts about geekery. no. those two go together perfectly. Anyway, i’m going to add some categories, and try to retro-categorise some of the old posts over time. RSS subscribers may see old posts reappaer for a few days/weeks/months/years

Frameworks make you forget

I’ve recently being doing a bit of “old school” web development, manually creating HTML forms and (classic ASP) scripts to validate and process the forms. I was surprised at how much I have forgotten of my basic HTML, since I have been using a framework (namely archetypes in plone) to do all the form generation, validation and processing for the last couple of years. I even had to go and view some source code on another site to remind me of the correct syntax for an HTML select element (form drop-down).

Whilst doing things manually is very laborious, it does give me a feeling of control back, and I am confident about debugging and modification in a way that I miss when relying on a framework. Wouldn’t want to go back to this form of development for any large projects though!

CompositePack drawer overlap plone 2.5

I’m experiencing a problem where the Kupu drawer used to select content when in design mode on a compositepack page gets overlapped by elements from the underlying page. I thought it was something I had done with a custom skin I was building, but when I switch back to plone default skin, the problem still exists. I don’t think I have come across this before, so my conclusion at the moment is that this is something unique to Plone 2.5

I am seeing this on Firefox 1.5.0.6 (PC & mac) and IE6 PC. CompositePack 1.0 Final

screen shot here (Firefox)

If anyone has a fix for this please let me know!

UPDATE: Fixed

I have now fixed this (thanks Emyr!).

I applied the following to my style sheet:-

.kupu-drawer {
z-index: 3 !important;
}

#region-content .contentActions {
z-index: 1;
}

(the !important is only necessary because of a precedence thing somewhere along the line)

Plone installable custom skins – how to deactivate the ploney bits

I’ve been using DIYPloneStyle to create custom installable skin products since.. err.. an early version, and the process always went like this:-

  1. use the generator.py file to create a new product
  2. install the skin product
  3. Use the css_registry to deactivate most of the plone style sheets, so that I don’t have to overide the styles in my custom CSS

The problem with this is that this can cause complications if there is any skin-switching capability, plus if you provide the skin to someone else to install you also have to send instructions to deactivate the appropriate stylesheets.

Today I downloaded the 2.1.2 version, and I was pleased to see that the blank skin product that it creates takes me to exactly the same starting point as I like to start from, i.e. all the plone default styles are deactivated. I say deactivated, but what I mean is there are blank public.css, plone.css etc files in the product, so when the product is installed, these have higher precedence than the ones in the plone layers. This is a much more convenient way to deal with overiding the styles, not sure why I didn’t think of it before!

dfrskatezine.com – what’s next?

Anyone who has clicked through to dfr skate zine on my case study links might have noticed a holding page. This is probably a bit premature as the site is still running behind it. The site will shortly be upgraded from plone 2.1 to plone 2.5. I don’t anticipate any problems, but having just gone way over schedule upgrading from a plone 2.0.5 site (with loads of custiom products) to 2.5, i’m being a bit cautious. I’m also using this opportunity to make some improvements to the site in order to make it better and attract some more contributors.

Netsight Plone demo as first Bristol Skillswap

Rick Hurst Plone demo bristol

many moons ago, back in february myself and Matt Hamilton of Netsight did a plone demo at the watershed media centre in Bristol. This was the first in a series of “SkillSwaps” as part of the Bristol branch of SkillSwap based in Brighton. I’ve only just got round to blogging about it now due to my blogging hiatus!

The video feed is online here (note that this link skips forward a few chapters to where I actually start talking – before that is several minutes of people arriving and introductions etc).

hypothecate is now (also) www.rickhurst.co.uk

so if all has gone to plan, my hypothecate.co.uk RSS feed should have burst back into life and anybody subscribed to my old RSS should now be reading the feed from www.rickhurst.co.uk, my new personal blog / portfolio site, running on wordpress.

so lets get this right , I spent hours and hours migrating hypothecate to plone then binned it and went for wordpress instead? yep. For the last six years or so I have always used (much appreciated) free webspace from people I know, but this always tied me to a platform – first ASP, then zope/plone. Now I have another personal project running on Plone (www.dfrskatezine.com – ironically currently offline while I migrate it from plone 2.1 to 2.5), I thought I would stump up for some paid webspace so I could run some php/ mysql stuff without relying on favours and harrassing people to install and configure stuff for me.

The new site has a bit of a portfolio on it, as I am pimping myself for a bit of non-plone freelance work (out of hours – i’m still happily esconced by day ploning away at netsight hq), so any bits of web development work you need doing, contact me and I might be able to help you out, and you might be able to help me replace my dying car 🙂

Now I have working blog software again, I might even start posting a bit more often – still on the same theme – web technology with random inane drivel thrown in.

The old site will eventually redirect here, and I will do my best to not leave any dead links, by setting up some redirects. In an ideal world I would retro-categorise all the imported content on here.

As for quills etc have I completely given up? no – quills should make an appearance on the skate site in the near future.

Format Date in ZPT

Just a quick example of how to format a date in ZPT. DateTime is already available within the Plone environment, so you can do something like this:-

item_date item/EffectiveDate;
item_display_date python:DateTime(item_date).strftime(‘%B %d, %Y’);

The above example formats the date in a US style e.g. 3 July, 2006

Plone 2.1 comment bug

I discovered an annoying bug with plone 2.1 where when you added comments to a piece of content, they seemed to disappear, without throwing an error. It turns out they were turning up in their parent container.

It only occurred intermittently, and seemingly randomly (aren’t they simply the best type of software bug?), but I eventually realised that it started occuring where a folder was set to Allow Discussion by default, and it was occuring where a content item hadn’t previously had any discussion, therefore it was inherting the discussion properties of its parent..

Anyway, I sheepishly showed my head in the plone users IRC channel and was advised to (guess what!) upgrade to 2.1.2 to fix the problem. Got out of there sharp quick before anyone asked me to contribute anything useful.

As per usual simply upgrading to the latest version isn’t always a possibility with a live site, particularly where there are several production sites running on the same zope instance and with no hugely convenient way to create an exact replica for a test run of a migration.

So I installed a fresh instance of 2.1.2 locally (gotta love that clicky button mac osx installer – that’s my type of software installation), checked that the bug was indeed fixed in 2.1.2 and then did some digging, stepped through the code a bit and found that CMFPlone/DiscussionTool.py had changed slightly. (I’m sure I could have checked some sort of changelog or SVN repository, but without someone to spell it out to me, finding out what/where/when how to do such a thing would probably take me longer than it would to knock up my own commenting system from scratch.

So I swapped the file, refreshed CMFPlone and …Doh!!! something bad…, swapped it back, refreshed and .. Doh!!.. still bad.. panic a bit, ask around if anyone else just happened to be doing something on that zope instance that might be causing the bad stuff, but no… so restarted the zope instance and it started working again, swapped the files again, restarted and lo and behold commenting fixed.

plone 2.1 list all folders set to display as photo album

since plone 2.1 uses folders set to display as photoalbums instead of the CMFPhotoAlbum approach, I needed a way to list photo albums from a portal_catalog query (well, a smart folder actually, but the same thing really)

here’s a solution:-

1. in the zmi go into portal_catalog -> indexes
2. add a new FieldIndex called “layout”
3. reindex the catalog

now you can use layout in portal_catalog queries so a query containing type = Folder, layout=atct_album_view will return a list of folders set to display as photo albums