Similar to the instant-messaging application installed previously, the capability to have a photo album content type in your Plone community requires two packages: CMFPhoto and CMFPhotoAlbum. Both are required to achieve the goal of allowing members to create and share photo albums, and, as such, are downloaded as separate packages.
Installing CMFPhoto and CMFPhotoAlbum
To install CMFPhoto and CMGPhotoAlbum, first download the packages from the CMF Collective and use your unzip utility of choice (perhaps WinZip on Windows, gunzip on Linux/Unix) to extract the files into a subfolder within the Data/Products folder in the Plone installation directory.
To finish the installation of CMFPhoto and CMGPhotoAlbum, use the Add/Remove Products option in the Plone setup section, available to the Plone administrator user . You must restart Plone for CMFPhoto and CMGPhotoAlbum to show up as elements to be added, after extracting them into the folder described earlier. After restarting, log in as the Plone administrator and follow the Plone Setup link in the navigation; then follow the Add/Remove Products link. You will see a list of products available for installation. Check the boxes for both, and press the Install button. The installation actions occur, and you should see a message indicating the successful installation of each package.
With CMFPhoto and CMFPhotoAlbum, there are no additional options to configure, so no elements are added to the Add-on Product Configuration section of the Plone setup menu. After you have installed CMFPhoto and CMFPhotoAlbum, their functionality is available to you upon your next login.
Creating a Photo Album with CMFPhotoAlbum
After CMGPhotoAlbum has been installed, a new content type is available to members: a photo album. A photo album is essentially just a folder that is specifically designed to hold photos. To add a photo album, select Photo Album from the add new item drop-down in your member photo. The form for adding an album is quite simple, as shown in Figure 4.11.
Figure 4.11. Adding a photo album.
The fields in this form are as follows :
Short Name ” This becomes part of the URL to the photo album, much like the Short Name field used in other content types. This short name should be relatively descriptive but should not contain underscores or be mixed case. If you do not input your own short name, Plone creates one for you.
Title ” The title is used as the text for a link to your photo album. It is required.
Description ” This is optional text appearing below the title.
These three fields are the only editable items for a photo album. Now you can move on to adding photos to your album and publishing it.
Adding Photos to a Photo Album
Just as a photo album is really just a folder that holds photos, adding photos is not dissimilar to adding other content types inside a specific folder. After your album has been added, navigate to the View tab for this item. The Add New Item drop-down list contains two entries: Photo and Photo Album. You can add another photo album inside the current one, but for our purpose of introducing you to the process of adding photos, select the Add New Photo entry to add a photo and invoke the Edit form.
This is another simple form:
Short Name ” This becomes part of the URL to the specific photo, much like the Short Name field used in other content types. This short name should be relatively descriptive but should not contain underscores or be mixed case. If you do not input your own short name, Plone creates one for you.
Title ” This is used when viewing the photo on its own page.
Description ” This is used when viewing the photo on its own page.
Image ” This is required. Use the Browse button to find the file on your filesystem that you want to upload.
Figure 4.12. The Edit Photo form.
After you have added the image, you can do all sorts of things with it. Of course, you can edit the short name, title, and description, but you can also rotate your images. When viewing an image in your photo album, select the Properties tab to revisit the Edit Photo form, and select the Transform Image tab to find the Photo Rotation tool.
To delete entries from your photo album, simply select the Contents tab when viewing the photo album itself. This view shows the line items (photos) in the folder (photo album), just as if you were viewing the contents of your member folder itself. Check the check box next to the item that you want to delete, and press the Delete button. Your photo is removed from the album and from the Plone site in general.
The End-User View of a Photo Album
When you have finished adding items to your photo album, be sure to publish it (or place it in the publishing queue for approval, if you are not the administrator) so that others can enjoy it. When a member navigates to the initial view of another member's photo album, that member sees a set of thumbnail images, such as those shown in Figure 4.13.
Figure 4.13. End-user view of a photo album.
Each of these thumbnails is clickable; clicking on one displays the photo page with a larger image, the title of the image, and the image description. The end user can resize the view of the image without changing the size of the original file, by selecting a size from a drop-down menu on the photo page. The available sizes range from thumbnail (128 x 128 pixels) to Xtra Large (1,024 x 1,024 pixels). Additionally, the user can navigate the album linearly by selecting Next or Previous, as appropriate, in the album view. Or, the user can jump to a specifically numbered image using the same album view.
Photo albums definitely lend a sense of personality to your members' areas, and using CMFPhoto and CMFPhotoAlbum is as simple as adding any other content type in Plone. Next, you'll discover two more useful Plone add-ons: The first is one of many available blogging tools. The second is Zwiki, which is not a blog, but a whole different animal unto itself.