Sections
Personal tools

For a novice at plone

Read this if you're a novice to plone. I am also a novice.

This is a part of how-to about "Using Topics and Smart Folders" on http://plone.org/documentation/how-to/using-topics

Smart Folders vs topics This was originally written for Plone 2.0.3. Topics are a little different in Plone 2.1. I haven't used them much yet, but I've added some initial observations to this text.

In some places where I've referred to topics, I mean the topic objects avaliable to Plone 2.0, but in others I mean either 2.0's topics or 2.1's Smart Folders, so I hope it still makes sense.

For a start, in Plone 2.1 they are called Smart Folders, are more flexible and appear easier to use and have less bugs. But they basically achieve the same thing. You could probably work out how to use Smart Folders by trial and error, but topics are trickier so they have been less popular than they could have been.

Note that Apple's Mac OS X can create what they also call Smart Folders. I assume the concept is similar, but they have nothing to do with Plone's Smart Folders.

What are topics?

Topics are a metatype based on folders, so they act a little like folders in that they will appear in your navigation menu. Rather than displaying their contents when viewed, they display the results of a search of your site. They can have criteria which limit this search. If they have no criteria, then they find everything. They can also have a sort order defined, and that alone can be useful. Only managers can create them (not sure if this is true of Smart Folders).

What good are they?

Topics are handy when, for example, you want to show a list of all news items or events within the whole site or a particular folder (and its subfolders). Or you might need a list of all unsubmitted documents, sorted from newest to oldest. They allow you to be freed from having to keep items in the folders they will appear in in your site's menu structure, and to avoid having to duplicate items that need to appear in several places. You can keep everything in a single folder if you like, and have them appear in several/various places in your menu according to their contents.

Subtopics

They can contain subtopics (they're called subfolders when you're using Smart Folders), which behave like any other topic, except that they can optionally inherit they parents' criteria, allowing then to display a subset of the objects their parents display. A subtopic will appear in your navigation menu like a subfolder would (but only when you're viewing it).

How do they work?

They work by querying the portal catalog, which is quicker than searching each object one by one for matches. I'm under the impression that the list of matching objects for each topic is stored and maintained somewhere in the catalog, so that viewing a topic involves no search time at all. (Could someone confirm if that's true? I have feeling it's not.) Thus, if you manage to get an item into your site without it being cataloged (i.e. adding or modifiying an object via the ZMI instead of Plone), then it won't appear in any topics.

Creating them

To create a topic, add one to your main folder or a subfolder like you would any other object, by choosing Topic from the pullown list of object types in "Add new item". Give it an id (shortname, which becomes part of the URL) and a title (which is what will be displayed in the menu and folder listings), and click Save. The topic will be saved and you'll be taken to the criteria tab.

If you leave the topic with no criteria, then it'll find everything in your site.

Criteria

Smart Folders have an additional "criterion", accessed from the Edit tab. You can specify whether to limit the number of results returned, and how many to return. Very useful if you want to use the results in a small portlet, for example.

To create a criterion you must choose a field name and criteria type, from the pulldowns on the form, then click Add. (It should probably be a "criterion type", but that's what the form says.) The field names you can choose from are those listed in /portal_catalog/indexes. Most of them should be familiar and self explanatory, but a few are not: