Re: [cmsb] code for when someone clicks on a thumbnail it opens the larger photo in a new window
Hi there,
I'm not sure that I can provide the full detailed explanation you're seeking. That would take a while and also would depend greatly on the specifics of your site. However:
1 - What you're looking for is called a "lightbox". There are many dozens of them available for free or low-cost. Just do a Google search for 'jQuery Lightbox' and you'll find lots of choices to get you started. They all rely on javascript so they use something like the jQuery or MooTools base libraries to work. So you'll have to add those to your site also. There are many tutorials on how to do this online. FWIW, I like FancyBox 2 (
http://fancyapps.com/fancybox/) but that is a commercial product. There are lots of excellent free ones.
In a nutshell, after you install jQuery and the lightbox add-on library, you'll follow the lightbox instructions to adjust the anchor/link which wraps your thumbnail so that it triggers the use of the lightbox when clicked. You'll wind up with something that may look a bit like:
<a href="fullSizeImage.jpg" rel="lightbox"><img src="myThumb.jpg"></a>
or
<a href="fullSizeImage.jpg" class="lightbox"><img src="myThumb.jpg"></a>
I don't think you'll want to have this applied to all images on a site or you'll start opening lightbox with every graphical element of your design. However, you can easily make CMSB add the lighbox code to images added to the site via an upload field. For images added by clients via a WYSIWYG editor, you'll have a bigger issue for various reasons. Because of that, we usually create explicit 'upload gallery' fields in our CMSB editors.
2 - The position of your images on your public pages will be determined by where the user inserts the images in the editor and what CSS rules are being applied. This is where seeing the actual site becomes important in order to offer a specific solution. Sorry!
J.