This is a simple HTML page to give a very basic demonstration of how to setup gallery of images and make them editable using CushyCMS.
Caveat: this solution requires javascript, and uses repeatable regions in CushyCMS which are only part of the pro features<ul class="cushycms gallery"> <li> <a href="gallery1.jpg" class="fancybox" rel="gallery" title="The Floating Garden (2012)"> <img class="cushycms thumbnail" src="gallery1_thumb.jpg" title="The Floating Garden (2012)" width="320px" height="240px" alt="The Floating Garden (2012)"> </a> <img class="cushycms main" src="" title="main image" width="480px" height="360px"> <h5 class="cushycms-html description" title="description">The Floating Garden (2012)</h5> </li> <li> <a href="gallery2.jpg" class="fancybox" rel="gallery" title="Fluorescence (2000)"> <img class="cushycms thumbnail" src="gallery2_thumb.jpg" title="Fluorescence (2000)" width="320px" height="240px" alt="Fluorescence (2000)"> </a> <img class="cushycms main" src="" title="main image" width="480px" height="360px"> <h5 class="cushycms-html description" title="description">Fluorescence (2000)</h5> </li> <li> <a href="gallery3.jpg" class="fancybox" rel="gallery" title="Episteme (2006)"> <img class="cushycms thumbnail" src="gallery3_thumb.jpg" title="Episteme (2006)" width="320px" height="240px" alt="Episteme (2006)"> </a> <img class="cushycms main" src="" title="main image" width="480px" height="360px"> <h5 class="cushycms-html description" title="description">Episteme (2006)</h5> </li> </ul>
$(document).ready(function() { $('ul.gallery li').each(function() { // Find the main image for this particular fancybox element. var image = $(this).find('img.main').first(); var thumb = $(this).find('img.thumbnail').first(); var desc = $.trim($(this).find('h5.description').first().html()); var link = $(this).find('a.fancybox').first(); // Set the href for each link to be the src of the main image inside that link (which is currently hidden). link.attr('href', image.attr('src')); // Also remove the src from the main image so the browser doesn't download it. image.attr('src', ''); // Fix the title & alt tags of the thumbnail. thumb.attr('title', desc); thumb.attr('alt', desc); link.attr('title', desc); // We're ready to enable the fancybox! link.fancybox({ helpers: { title: { type: 'inside' } } }); }); });
The basics for this particular implementation should hopefully be pretty easy to follow. Here are some things to note if you view the source of the above gallery.
Here is a screenshot of how this looks to your editor. We have only taken a sample of the edit boxes for one of the images above. This will of course be repeated for all 3 images. As you can see in the top right, there are control buttons for your editor to clone the entire editable group. This will clone the whole <li> element from the example code.