gallery for all anchored images without group tag?

Page: 1

Author Post
Member
Registered: Sep 2017
Posts: 6
After years of using Floatbox 3.51 I decided to upgrade and register 7.4.1. Transition is quite easy but I have one problem.

I have the autoGallery set to true. In the past all images with <a href="image.jpg"></a> would automatically grouped and shown as "image x of n" and with navigation buttons to left/right.

After upgrading I have to add data-fb-options="group:1" to each anchor.

So I'd like to use...

<a href="image-1.jpg"><img src="image-1_thumb.jpg" /></a>
<a href="image-2.jpg"><img src="image-2_thumb.jpg" /></a>


... instead of
<a data-fb-options="group:1" href="image-1.jpg"><img src="image-1_thumb.jpg" /></a>
<a data-fb-options="group:1" href="image-2.jpg"><img src="image-2_thumb.jpg" /></a>


How can I achieve this?
Member
Registered: Nov 2010
Posts: 71
Just enclose your images in a <div>

<div class="floatbox" data-fb-options="group:1">
<a href="image-1.jpg"><img src="image-1_thumb.jpg" /></a>
<a href="image-2.jpg"><img src="image-2_thumb.jpg" /></a>
</div>


Not sure if autoGallery is a valid option in version 7.4.1.
Administrator
Registered: Aug 2008
Posts: 3382
Like Mr. Steve says, wrapping the gallery links in a div (or span or whatever) and putting the floatbox class and options on that containing element is an efficient way to avoid assigning the same options to multiple links.

If you want all the images on a page to automagically group as a gallery set, you can assign the group name via type: image:, either for all pages in the fbOptions.js file or per page in an fbOptions definition set on the page.
fbOptions: {
type: {
image: {
group: 1
}
}
}

This is especially convenient when used in conjunction with the new(ish) activateMedia option which lights up links on the page without the need to assign the 'floatbox' class.

autoGallery is long gone
Member
Registered: Sep 2017
Posts: 6
Thanks. Setting the type: image: to group:1 was exactly what I was looking for. Works like a charm now. And for autoGallery I must have looked into the old 3.51 docs.

Page: 1