This article will give you an overview of the strategies available for implementing a gallery.
The Oncord page editor will allow users to drag-and-drop a generic image gallery onto the page, however for more development control you may opt to build a custom solution.
Populate with Posts or Media?
There are two primary methods of implementing a gallery; using page media, and using posts.
1. Using Page Media: Create a media folder (such as "gallery"), and populate the gallery with all images in that media folder.
2. Using Posts: Create a Post Category, and populate the gallery with all Posts assigned to that Post Category.
Media Folder Image Gallery
Page media can be used to populate an image gallery. Click
here to view a tutorial.
- It's easier for an administrator to manage this type of gallery.
- This method is great for galleries with a large number of items, because Oncord supports multiple file upload through attached media.
- The posts section of the dashboard stays neater, because it isn't populated with gallery images in addition to blog / news posts.
- There's no way of linking gallery images to anything other than a larger version of an image.
- You need to use PHP to generate an image title from the filename.
You can't add extra image details such as descriptions, publish dates etc, as these can't be derived from an image in a folder.
Post-based Image Gallery
The posts component of Oncord can also be used to populate an image gallery. Each gallery image will be a post.
- You can have more information associated with your gallery images, such as a title, short description, publish date, author.
Better Accessibility - Because you have more data available about the image, the image title and alt attributes will be more accurate for
use with blind interpreters (as long as you don't leave fields blank).
- Better SEO - Again, more data about the images means you can include more details in the title and alt attributes, helping to improve your SEO.
- Uploading images takes much longer, you'll need to create a post for each image in the gallery.
- The posts section of your dashboard won't be as neat, because it will be populated with blog articles as well as gallery images.
- This method is slightly harder for admin users to manage, they'll need to be familiar with how Posts work on Oncord.