-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
Here is an example that I had in my web project. A dance studio organized a Gala Evening Party. I was supposed to publish information about it on the website in 2 sections (you may click the links to see the final results):
- Photo gallery that contained a full set of photos taken at this event.
- A review in the blog which mainly consisted of textual information, but also included a few mini photo galleries to give a quick idea of the atmosphere. Photos of each mini gallery were united by a topic: kids dances gallery, adult dances gallery and photo session gallery (3 mini galleries in total).
A standard approach (without FolderEx) for this task would be creating a folder for each mini gallery and an extra folder that contains all the images. Then creating a Gallery widget with a Folder as a source content and selecting appropriate folder for each widget. The drawback of such approach is the useless redundancy of images: I have to duplicate the images in folders for the mini galleries and then also have a copy of them in the folder that contains all the photos. Such redundancy is bad, because it adds extra unnecessary consumption of disk space and you will have multiple copies of the same image which is not good for SEO.
To fix this situation I could try to use a Custom type as a source content, but in this case I would have to select all the images manually, and if you have lots of photos, it becomes a stupid and time consuming task.
The FolderEx helps in this situation. It allows to store all the photos in a single folder and then automatically pick only those that are required using a filter.
Anyway we will need to use 3 widgets here. I used a standard Gallery widget, because I didn't need any extra functionality here:
For the main gallery that contains all the photos it's OK to use FolderEx or standard Folder Content Provider, because extra functionality is not required here:
For mini galleries we need to use the [RegExp Filtering]((https://github.com/rvalitov/widgetkit-folder-ex/wiki/Filtering-Patterns) to pick only the required files.
Below are the settings used for mini galleries:
Mini Gallery | Example of Image File Name | RegExp Pattern |
---|---|---|
Kids | dubai-gala-evening-kids-dance-001.JPG |
`/kids[^/\]*.(jpg |
Adults | dubai-gala-evening-adult-dance-002.JPG |
`/adult[^/\]*.(jpg |
Photo Session | dubai-gala-evening-photo-session-002.JPG |
`/photo[^/\]*.(jpg |
The screenshot of setting for the Adults mini gallery:
The screenshot of setting for the Photo Session mini gallery:
In the end we have 4 different Gallery widgets that use the same folder as a source for the images without any duplication of files.