Install the extension via the extension manager as every other extension. Let the extension manager create all tables and folders.
Since v0.5, the database layout has changed. If you are upgrading from a version below v0.5, you need to re-assign images to albums. This can be done by synchronizing your albums (which would result in image regeneration) or by editing the album records in the backend. When you perform the 2nd method, keep in mind, that only images from the current page are assignable.
From v0.7 to v0.8 I also changed Typoscript Constants and Setup. Please refer to the reference documentation at the end of this document if you have problems upgrading to v0.8.
Before I go through the steps necessary to set up this extension, let me try to explain the basics behind the scenes by defining key words and how they are connected.
The fundamental object is an image. Images are presented by a filename, a corresponding record in the database and are contained in an image album. An image album itself again is contained in one or multiple categories. Since nobody starts with fundamental objects when trying to organizing them, the entry point for a gallery are category objects. This implies that an album has to be contained in at least one category in order to be visible.
Based on this definition, the extension separates these 3 abstraction levels onto different pages. A page that displays all categories including their album references is called a LIST page. The references point to the ALBUM page, where only one album is displayed, referencing the single images. Each image is then rendered on the SINGLE page. Okay, so far so good, but where do the records come from? Unlike many other extensions, I prefer a clean separation between pages rendering content and the content itself – thus requiring a sysfolder which holds our records. This sysfolder can be seen as a library, where all images, albums and categories are organized. In terms of Typo3, this sysfolder is called the starting point for the extension.
Now that we have cleared the basics, lets set up the required pages.
Abbildung 1: A basic page tree for the gallery
In Figure 1 you can see a basic page tree which conforms to the definition above. The Gallery page (id = 11) will display a LIST, Album Page (id = 12) will display ALBUM and Single Page (id = 13) will render the SINGLE view. Note that the latter two pages are created as “Not in menu” in order to hide them. Apart from that, accessing these pages directly would result in errors, since the extension requires the album and image ids to be given for these pages. Finally, the sysfolder Library (id = 14) is going to contain our records. All of this has to be told to the extension by defining the appropriate Typoscript constants:
plugin.tx_jmgallery_pi1 {
list_pid = 11
album_pid = 12
single_pid = 13
admin {
repositoryRoot = 14
basePath = fileadmin/gallery/
}
}
In addition to setting the page ids, I have already defined in which folder all the albums will reside. If you do not plan to use the frontend administration tool, you can remove that line. It is only used if you create new albums in the frontend.
Next thing you have to do is to insert the frontend plug-in 'Website Photo Gallery' on the pages. For each one you have to set the corresponding code, as shown in Figure 2 below.
Abbildung 2: Frontend Plug-in setup on the different pages
If we visit the Gallery page in the frontend now, we won't see anything yet. No unexpected behaviour, we haven't created any categories and albums yet. If you are familiar with Typo3 BE editing, you can start creating categories and albums inside the Library sysfolder. Alternatively you can use the frontend administration part of this extension. Therefore you need to do a little more page-creation and Typoscript definitions. In particular you need to create an additional page, name it something like Gallery Administration set it to not being cached and make it only visible to qualified users. Analogous to above, insert the plug-in on this page with the code ADMIN and the starting pointing Library. Additionally, the following Typoscript setup is needed.
plugin.tx_jmgallery_pi1 { admin { ajaxRestrictions {users = 1
groups = 1
}
}
}
This tells the AJAX service which frontend users are allowed to perform changes on the records (if more than one specific user or more than one group should be allowed, list the ids in a comma-separated list without spaces). Without these settings everybody could call the AJAX service and change your records.
Note: The admin tool is completey AJAX based. There are no submit buttons for most of the actions. Changes are submitted on-the-fly to the server.
Note: In order to work correctly on Internet Explorer, the frontend admin tool requires the setting of the baseUrl parameter in your page template. This can be done by setting config.baseURL to e.g. http://gallery.m00re.de/ on your page object.
Finally you have to include the static template 'CSS-based template(jm_gallery)' in your root template to apply all the settings you have made through Typoscript constants.
That's it – nearly. Since the admin tool does not offer category creation yet, you have to create initial categories by hand in the BE. Once they are created, you can create albums in the admin tool for each category, upload images, sort them, name them, etc...
The ways in which you add new images to an album are different. You may either upload images through the frontend or by using techniques like ftp upload, ssh upload or similar. In the first case the image is immediately added after the upload. In the latter case, the extension will detect new images automatically (except when you have caching of the extension enabled).
The Commenting system is pretty easy to enable. First create a new sysfolder in which your comments should be saved, add 2 more frontend plug-ins on your SINGLE page, set the code to COMMENTS and FORM and add the following Typoscript constants.
plugin.tx_jmgallery_pi1 { comments {storagePid = 15
}
}
The commenting form comes with support for captchas. At the moment, the extensions sr_freecap and jm_recaptcha are supported. In order to switch between the two you have to set the Typoscript setup appropriately. In case you choose jm_recaptcha, don't forget to configure it correctly. This extension needs public and private keys from http://www.recaptcha.net/ for your domain.
plugin.tx_jmgallery_pi1 { display { FORM {# Set the next line to either 'sr_freecap' or 'jm_recaptcha'
captcha = sr_freecap
}
}
}
First create an additional page with a name like 'Send eCard', mark it as not being shown in the menu and add the frontend plug-in on it with code equal to ECARD and the starting point referencing the Library page.
Then set the following Typoscript constant to point to this page
plugin.tx_jmgallery_pi1 {ecard_pid = 16
}
plus the following Typoscript setup
plugin.tx_jmgallery_pi1 { display { SINGLE {showCardLink = 1
}
}
}
Note: In order to work correctly, the eCard feature requires the setting of the baseUrl parameter in your page template. This can be done by setting config.baseURL to e.g. http://gallery.m00re.de/ on your page object.
There's a project page at http://trac.m00re.de/jm_gallery/ which comes with a Wiki (feel free to share your solutions, templates, ...) and a Subversion Repository.

