Personal tools
You are here: Home Documentation Tutorials RichDocument: Creating content types the Plone 2.1 way Collapsible field-sets
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Collapsible field-sets

Displaying collapsible areas of a page with a minimum of effort

optilude

This tutorial will teach you how to create content types the Plone 2.1 way, using the ATContentTypes library, by following the example of RichDocument, an extension of Plone's standard Page/Document type.
Page 14 of 17.

Plone 2.1 comes with Javascript that scan a document for certain markers (usually CSS classes or id attributes) and applies some behaviour where they are found. For example, the "globe" icon that appears in front of any external link in your portal is applied by such a script.

RichDocument uses the collapsible field-set machinery written for the new History collapsible field-set to collapse the images and attachments manager widgets in the edit form. The mark-up is very simple:

  <dl id="image-controls" class="collapsible inline collapsedOnLoad">
    <dt class="collapsibleHeader">Title</dt>
    <dd class="collapsibleContent">

        ....

    </dd>
  </dl>

The existence of the "collapsible" class turns collapsing on. "inline" means that the field-set will not be a block level element. collapsedOnLoad, if present, will leave the field set collapsed when the page is loaded, otherwise it will be expanded until the user collapses it.

For the full example, see widget_imagesmanager or widget_attachmentsmanager.

 
by optilude — last modified September 5, 2005 - 10:59 All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by