Using the Database module to create an image gallery in CCLE/Moodle
Although Moodle does not ship with an image gallery module per se, the database tool can be repurposed for that function. It contains certain limitations as an image gallery, for instance:
- The database cannot browse to images stored in the Moodle File Manager, only to those stored on your hard drive.
- The database cannot upload images as a batch or in a zip file; all images must be uploaded one at a time.
- A complete image gallery/database CAN be moved from course to course. However, this can only be accomplished via Moodle’s Backup/Restore function, instructions for which I am including at the end of this document. The image gallery CANNOT be saved or stored as a file that can easily be dropped into another CCLE course.
Assuming that these limitations are acceptable, here is the process to create a new image gallery on CCLE:
- Turn Editing On for your CCLE website.
- Find the section where you want to add the image gallery.
- Open the “Add an Activity” dropdown menu for that section and choose “Database.”
- Fill in the “Name” and “Description” for the image gallery/database. All of the other fields are optional, and should be left at the default unless you specifically wish to change one of them.
- Press the “Save and Display” button.
- Within the database, you will see a series of tabs across the top of the page. Click on the tab that says “Presets.”
- Under the “Import” menu, select the radio button labelled “Image Gallery” and press the “Choose” button at the bottom of the screen. This preset will automatically populate your database with Image, Title, and Caption fields. If you want to change these fields, you can do it later by selecting the “Fields” tab at the top of the page.
- Press “Continue.” The overwrite existing settings button is irrelevant at this point, since your database currently has no settings.
- Click on the “Add Entry” tab to add an entry. As stated above, at this time, the Database tool can only find images stored on your hard drive, NOT in your file manager, and it can only upload images one at a time, not in a batch or zip file. Fields are Title, Caption, then Browse button out to the file. Field Alternative text, always a good idea to add a good description of the photo. Top will display, ‘Your entry has been saved’. You can then button Save and view or button Save and add another.
- Both the “View List” and “View Single” tabs will allow you to view the images. A set of icons below each image in those tabs will allow you to edit or delete individual images.
If you wish to reuse an existing image gallery/database in another CCLE course website, then you MUST use the “Backup/Restore” function in Moodle. There is no way that I have discovered to export the entire database as a file that can be moved from course site to course site. The “Export” button under the “Presets” tab only allows you to export your fields and the text content of those fields, NOT the image content (since it outputs .csv files, which have no way to include images). For smaller image galleries, however, where the instructor does not mind restoring the images manually, this may be the most effective means of transferring the gallery from site to site. The instructions to successfully Backup and Restore an image gallery are as follows:
- Click on “Backup” in the Admin block of the course that contains the image gallery.
- You can choose to only backup the database. However, you MUST choose to backup that SPECIFIC database, and you MUST choose to back up the User Data for that database.
- Set “Users” to “Course.”
- Click “Continue.”
- When the Backup report is given, click “Continue.”
- In the Admin block, click “Restore.” It doesn’t matter which course website you choose, since it will allow you to select the course site later.
- Find the backup file that you just created in the list of files and click “Restore” from the options to its right.
- Click “Yes” to continue.
- At the end of the Backup Details, click “Continue.”
- Finally, the course restore, AND THIS IS THE TRICKY PART. You can choose to create a new course or add the database to an existing course, as you see fit. But you must make sure to select BOTH the specific image gallery database AND its user data; the user data checkbox is stuck in the middle of the screen and blends into the text for the database, so it is easy to miss (I made this mistake numerous times). Once BOTH of those checkboxes have been selected, you can continue.
- For “Users,” choose “Course.” (If you don’t choose this, it will force it for you later.)
- Click “Continue.”
- If you chose to add the database to an existing course, select it from the list. The list is very unwieldy, and it would be nice to develop a better method of selecting the destination course, but until then, you must search through the list for your destination website.
- When it adds the database to the course, click “Continue.”
- This should complete the transfer. Check the image gallery on the destination course to make sure that everything came through properly.