Provides a way to create a treeish category structure and then limit the association of content intances to specific sections of the tree based on the contents type and user selections. It also provides an attribute system that works similar to keywords but allows for collections of attributes to be associated with multiple content types. Includes custom archetype fields for creating Archetypes that interact with PortalTaxonomy.
Since writing PortalTaxonomy several products have come along to fill the need for more advanced taxonomy management than is available out of the box with Plone. PT's niche, I think, is that it is very easy to integrate into a Plone site that wants to expose it's taxonomy as navigational elements. Also, I find the CategoryWidget and AttributeWidget interfaces helpful for providing clients with an easy interface for entering taxonomy information.
The main motivation was to have a centralized, recursive, categorization structure that could be associated with groups of content types. The current Plone KeyWord system allows for only a 1 to 1 mapping of keyword lists to types. KeyWords are also a flat list and I needed something that was treeish.
PortalTaxonomy provides two new primary content types: Categories and Attributes. Categories are hierarchical taxonomy nodes. You create a Category tree and then associate parts (or all) of the tree with various content types. By associating sections of the Category tree with a type, the types CategoryField will render that section of the Category tree in it's widget and allow users to select nodes in the tree with which to associate the content.
Attributes are grouped within a content type called AttributeCollection. An AttributeCollection is than associated with one or more content types. Content types associated with an AttributeCollection will have the Attributes within the Collection available as selection options within their AttributeField. You may specify how the AttributeWidget renders the selection options: as checkboxes; radio buttons; or selection lists. Each AttributeCollection is wrapped in in own grouping from which a user makes selections.
Categories allow site planners to create a treeish category structures and then associate content types with parts of the tree. Content types that use the provided CategoryField may be associated with categories within the tree.
To create an association between part of the Category tree and a content type, select the category that you want to associate. You will see a field called "Type Associations" that lists all the content types that have a CategoryField in their schema. Select the fields you want to associate with this section of the tree. The associated category and all sub categories will be available for selection in the types field.
This tool allows site planners to create "attribute collections" and than associate those collections with types by including an AttributeField in the content types schema. Attribute field is in the fields module included with PortalTaxonomy.
The AttributeWidget has several options available for rendering the attribute collections: as checkboxes; as radio buttons; and as selection lists.
Checkboxes allow a user to select as many attributes as they like from all associated Attributes. Selection lists do the same thing but present a multi selection list for each attribute collection associated with the field. Radio boxes allow a user to select one attribute from all available attributes.
To select a Checkbox, set the format property of AttributeWidget to "checkbox":
To select radio boxes, set the format property of AttributeWidget to "checkbox" and the box_type property to "radio":
To select selection lists, set the format attribute of AttributeWidget to "select":
Put the PortalTaxonomy folder in Zope's Products directory and restart Zope. Create a Plone site. Go to Plone Setup->Add/Remove Products. Select PortalTaxonomy from the list and click the install button.
An example type called TaxonomyType is automatically installed so you cna get started testing your taxonomy.
If you do not want the example type TaxonomyType to be installed, comment the line:
More on Usage
Both Category Manager and Attribute Manager look for Archetypes that use the CategoryField and AttributeField, respectively, in their schemas. Archetypes that use these fields will appear in a Categories or Attribute Collections "type restrictions" selection box. If no archetypes use those fields then the type restirctions selection box will be empty. To add a sample type, uncomment the #import example line in __init__.py, restart Zope and reinstall PortalTaxonomy (or install the TaxonomyType manually through the portal_types tool). This will give you a quick type to start playing with.
Create an Archetype that uses the PortalTaxonomy.fields.CategoryField field. Add categories and sub categories in your portal as needed, associating at least some of them with your new Archetype. Publish the Categories. Add a new instance of your Archetype. A category field selector should be available. Click on the categories to tree out sub categories. The category selector uses a modified nested pick list designed by Christian Heilman (http://icant.co.uk).
Create an Archetype that uses the PortalTaxonomy.fields.AttributeField. Add attribute collections to AttributeManager and associate at least some of them with your new Archetype. Publish your AtributeCollections and Attributes. Add an instance of your new archetype and check desired attributes.
Don't forget to add indexes to portal_catalog that corespond to your
Category and Attribute fields. There is a helper method called getContent
in both Attribute and Category manager. It is hard coded to indexes that
attribs respectivly. You can either name
your fields after these, modify the method or use catalog queries in your
page templates instead of the helper method.
Take a look in the skins directory for some example page templates, specifically: category_listing.pt, category_recursive.pt and list_view.pt.
If you have any comments regarding this product, please drop me an e-mail: firstname.lastname@example.org. Thanks :)
No stable release available yet.
|0.5||This version fixes a deprecation issue when used with Plone 3.0.2. It also adds some better examples as to how to integrate PT tagged content with a site. More about this release…||
|0.4.2||Bug fix release for 4.1. Fixed a few problems with the example TaxonomyType that were causing confusion. More about this release…||
|0.4.1||Bug fix release to get PortalTaxonomy working with Plone3 beta3. More about this release…||
|0.4||This release ads the ability to select categories from anywhere within the category tree. Previously, only leaf nodes were selectable. Also, AttrbiuteWidget now provides render options for: checkbox, radio and selection lists. More about this release…||
|0.3.1||This is a bug fix release. See release notes. More about this release…||
|0.3||Massive speed improvements, several bug fixes. More about this release…||
|0.2||Categories are now placed in the portal root to assist in navigation integration. Types may have multiple Category and Attribute fields. More about this release…||
|0.1||This product provides a way to create treeish category structures that can have content associated with sections of the tree based on user selections and content meta_types. It also provides a sort of keyword system that allows collections of attributes to be associated with multiple types. More about this release…||