Does your subclassed Plone product have metatype issues?

(dedicated to davisagli on Plone irc for taking the time to teach this old lady a new trick!)

Integrators are a special breed (if I do say so myself). Especially small-business-owning integrators who wear multiple hats, sometimes begrudgingly. One of those hats is troubleshooting issues that the client feels is important. The developers job is done and an issue has come up that was caused by a small change or request by the client, unrelated or a distant relation to the original specs for the project. It’s not really scope creep but it’s enough of an annoyance to the client that we as integrators are compelled to take care of it. We didn’t write the original product, maybe we hired someone or we are using a third-party product. Sometimes the actual solution is outside of our realm of knowledge so we seek out our peers to help us resolve it.

In this case we had a product called CaseStudy for a university. The CaseStudy product was subclassed from another content type (the File content type). The CaseStudy type was basically a file and a few fields so it made sense to subclass from that content type.

The product was installed and testing began. As part of the process a custom view would be implemented for the CaseStudy collection and for the CaseStudy project page. These were not an issue, views were created and added (I’ll write a post on how to add a custom view to your product and how to deal with multiple views).

There was one issue, when you clicked on an item (the link to open the CaseStudy project page) a download box would pop up. The expected result when clicking on the CaseStudy project page link was to go to the CaseStudy project page.

The quick & dirty Zope Management Interface fix was the following:

  1. Go to the ZMI
  2. Find portal_properties/site_properties
  3. find typesUseViewActionInListings field
  4. Add your content type – ours was CaseStudy
  5. Save changes

Now when we clicked on the link for our CaseStudy it went to the right view.

If you want to move this to your product so that the next time you install your product this will work correctly, do the following.

  1. In your ZMI go to portal_setup
  2. Click on the export tab
  3. Find Plone Properties (#15 on my setup)
  4. Click the checkbox next to Plone Properties
  5. Scroll down and select “Export Selected Steps”
  6. Save the file to your desktop
  7. Unpack the zip file and save the file (propertiestool.xml) to your desktop
    It will look like this:

So now you have something that looks like this, scary isn’t it?

For your own product you don’t have to include the entire base file from Plone’s propertiestool as long as you include purge=false within the property tag. The purge=false acts as a way to attach this new property name to the original properties file. If you don’t add purge=false you will break your properties because it will only use what you have included in your xml file.

Our propertiestools.xml file (in /profiles/default) looks like this:

I hope this helps someone. I’ll be making changes to this as I learn more about Generic Setup and using it to export/import steps.
Rather than adding your file to /profiles/default on your file system you can also import the propertiestool.xml file using the import tab in portal_setup.
I haven’t done that yet. I’ll add that direction once I have.

C2E Training Online Update

Update on planned sessions for C2E Training Online

Our 4 hour sessions, designed to help get you started with customizing/using Plone.

C2E Training Online: CSS for Plone – Beginner
April 28, 2009 – 8am – Noon (Pacific) http://c2etraining090428.eventbrite.com

C2E Training Online: Plone for Content Managers
April 29, 2009 – 8am – Noon (Pacific)
http://c2etraining090429.eventbrite.com

C2E Training Online: CSS for Plone – Advanced
April 30, 2009 – 8am – noon (Pacific)
http://c2etraining090430.eventbrite.com

C2E Training Online: Viewlet Mastery
May 12, 2009 – 8am – Noon (Pacific) http://c2eonline090512.eventbrite.com

**3- day class, 4 hours each day**

C2E Training Online: Plone 3 Themes and Custom Views

May 5, 2009 – May 8, 2009 from 8am – 12pm pacific daily http://c2eonline090505.eventbrite.com

(Register for this class by April 24, 2009 and you’ll be entered in a drawing for 1 of 2 copies of Veda Willams’ Plone 3 Theming book (coming out in May)

ATTENTION: This class is online and does not require travel.

This online class will be a workshop. Be prepared with a design you want to convert to Plone. We will start with a photoshop file or a design that you need to convert to Plone (can be an existent website with no photoshop file). We will setup Plone on our system together and create a filesystem theme product (installing and using buildout).

Topics we will cover:

  • Installing Plone (Unified Installer)
  • Creating a file system product with paster
  • Preparing our development environment for skinning
  • Learning the directory structure of your new Plone theme product (what goes where)
  • CSS for Plone
  • Best practices for Plone theme development
  • Working with Viewlets and viewlet managers (adding/hiding/moving)
  • Learn how to customize through the zmi and export to your skin
  • Adding styles to Kupu
  • Working with portlets and portlet managers
  • Dealing with cross browser issues

I’m limiting the actual class size to 20 people but will make a recording of the class available after the session for those who are visual learners and have an extremely busy schedule and want to view the course on their own time. (fee for recording is the same as the class) – email me if you want a recording of the class.

The class will be a combination of lecture and hands-on.

Until April 24 the fee for this online class is only $200 – after April 24th it will be $300.

http://c2eonline090505.eventbrite.com

(I usually hold an optional follow up session for students about 2 weeks later to see how everyone is faring with their new design and answer any questions that come up)

Feel free to email me with any questions. Hope to see you there!

C2E Training:Creating Plone 3 skins and custom views

Recognizing the need for training in customizing the look & feel of Plone, C Squared (C2E) will start hosting quarterly training sessions focused on the “art of theming”.  Our first 3 day session is scheduled for  March 18 – March 20, 2009 and will focus on creating a Plone 3 theme product.

Trainees will be able to convert a photoshop file to an installable Plone 3 theme product. Training will include comprehensive css training (with more focus on Plone specific css), making sense of viewlets and portlets, adding your own css and javascript files, understanding generic setup profiles (making your changes in the zmi and exporting) and best practices for theming Plone sites.

Knowledge of Python is not necessary but basic knowledge of *nix or windows command line and comfort with working on the filesystem is suggested.

Please register for the course here

C2E Training offers a variety of Plone specific training sessions including sessions for content managers, integrators and designers. If you are in need of training for your organization please feel free to contact us at (408)866-1300