HOWTO: Introduction to Smartfolders
SEE: http://learnplone.org/documentation/tutorial/smart-folders/creating-your-own-smart-folder-part-2
Let's say you have a large catalog of photos and maps on your website. You can easily display them all at once by creating a hyperlink to the folder they're stored in. You could even create different links for subfolders if you've organized things that way. However, there is no way with normal folders to display different content, from different parts of your site based on things like:
- keywords in the title
- date of creation
- author
- type of content
The need for showing content in a variety of dynamic ways has given rise to Smart Folders, or folders that know a thing or two about your content. However, the very name Smart Folder is actually a little misleading because Smart Folders don't actually contain content. They do contain criteria, very similar to a search query, that controls exactly what you see in each Smart Folder.
Applications for Smart Folders are commonly:
- News Archives
- Event Archives
- Photos Displayed by Date Range
- Content Displayed by Keyword
To start understanding just what Smart Folders do, let's explore some existing ones that will search this site for:
- Any content with the word "biomass" in the body text
- All links to content on "environmental stregthening"
To start with, I'm going to show you how to create a Smart Folder that will display all the links found on your website.
- Go to your group or personal folder area to keep your Smart Folders.
- Click on the Add Items tab and select Smart Folder from the list.
- Notice that you're now working in the Edit tab for this content item. This screen is for naming the Smart Folder and choosing display options.
- Notice that you're now working in the Edit tab for this content item. This screen is for naming the Smart Folder and choosing display options.
- Give your Smart Folder a Title and Description.
- You may now choose to Limit Search Results (optional)
- Limiting results only limits the number of results per page, not the total number of results found
- You may also choose to display results in a table. This is optional (the default display is a vertical list) so you can play around with this if you like.
- Push Save to create the Smart Folder.
At this point the Smart Folder exists, but it doesn't do anything because you have to give it some criteria to tell it what to do. As you might expect, click on the Criteria tab to finish your Smart Folder set up.
Notice that there are two boxes, so to speak. One is labeled Add New Search Criteria, and the other is labeled Set Sort Order. Ignore Set Sort Order for the moment.
Under Add New Search Criteria are two drop-down menus called Field Name and Criteria Type. Click on the Field Name menu to see all the choices. To create a News Smart Folder, choose Item Type.
You may notice that when you select Item Type, that there is only one choice for Criteria Type. That is because you must push Add to create the search criteria, then you can select the exact content type that your Smart Folder will search for. Other Field Names such as Creation Date will give you more than one Criteria Type to choose from. In the example on the right, you can choose a Creation Date range or relative date.
After pushing the Add button, the top of the Smart Folder screen should look like this:
![]()
To delete a criterion, use the check box in the first column and push Remove.
From the list under Value find News Item and select it. You may select several Content Types from this list by holding down the Control button when you click on content types. If you do select several Values from the list, you can join them using the Operator Name to search for News AND Files, or News OR Events. When your're finished with this, push Save.
You're now looking at three boxes on the screen. The top box is the criterion you we're just working on. The second box allows you to Add New Search Criteria. This is how you could, for example, search for News Items (criterion one) created before July 1st (criterion two). The third box is Set Sort Order if you wish to change the order the results display in.
Note: All the above only works if you actually have News Items on your Plone site. If you do not, try changing the Item Type to Page. That should show you some results.
