numIndexLinks on some groups in page but not others

Page: 1

Author Post
Member
Registered: Mar 2009
Posts: 42
Location: UK
I'm trying to create a page which has a floatbox gallery of about a dozen images, any one of which when clicked, may or may not show a further sub-gallery in the same box, of pictures relevant to the image originally clicked on. The link to the sub-gallery uses the caption:#divname construct with onclick="fb.start('idnameof1stimage'); return false;" and each image in a subgroup has the group:<subgroupname>.

I'd like only the subgroups to have numIndexLinks with popups displayed, but setting numIndexLinks:-1 in the subgroup's data-fb-options (or individually on each item) does not result in any links being displayed.

If I set numIndexLinks:-1 in the outer group's data-fb-options then the outer group gets popup-ed links, and the subgroups also get indexlinks displayed but with no popups.

Am I (as usual ;) ) trying to make fb do something it can't do?
I'll try to post a link to an example page, but it's too late tonight... :)
David
Administrator
Registered: Aug 2008
Posts: 3382
Without that example page, I need to speculate a bit. A couple of things to note that might be relevant:

data-fb-options get assigned to <a> and <area> elements that have or inherit the floatbox class, and to nothing else. The fact that you're assigning your own fb.start() onclick actions tells me that you are not working with standard floatbox links, and so should not expect the options to have any bearing.

The way to apply options to an fb.start call is to provide them as the second parameter in the call. E.g., fb.start( 'idnameof1stimage', 'numIndexLinks:-1' )

For the index links to be able to show a thumb, they need to have a thumb to show. This is normally the thumbnail in the standard floatboxed link, but it doesn't sound like you're using standard class="floatbox" links. You can also use the per-item option indexThumbSource, but you can't pass per-item settings into a gallery set through the fb.start option parameter.

If you could just configure standard class="floatbox" links to define your gallery sets, include thumbnails in those links if you want index thumbs, and let Floatbox use it's standard click action to start those galleries instead of defining your own fb.start actions, I think none of your struggles would occur. Note that you can hide the links or the thumbs from view with css display:none if you don't want anything visible or clickable to show on the page.
Member
Registered: Mar 2009
Posts: 42
Location: UK
Well the fb.start() thing is a legacy from something you told me to do when I was using Floatbox 4.n! I wanted to have a link in a caption, to open another floatbox group, and that was the suggested method.

It works these days of course with just an <a href link in the hidden div, and that's what I've now done after your first comments, but I still can't get the indexlinks, let alone their thumbnails, to show up.

Presumably fb creates thumbnails itself from the original images, as I can't see any extra image links in your demo example - also what determines their default size?

Here is my test page. The only image with a sub-group so far is the third image along, called "The South Saxons, The Star Inn,Pevensey"
The subgroup 'sameBox' gallery of three images launches perfectly from the link in the caption, but there are no indexlinks to be seen.

Test page

Sorry if I'm being dumb...
Administrator
Registered: Aug 2008
Posts: 3382
I'm 95% lost.

There are no images on that test page, so I'm not sure it's loading correctly. When I click on that Pevensey link, the page simply reloads. You're going to have to tell me exactly what to click on and what results I should be looking for that differ from your expectations.

Quote
Presumably fb creates thumbnails itself from the original images
That would be a false presumption. Floatbox uses the thumbnails inside the floatboxed link. <a ... ><img ... /></a>. The <img> is the thumbnail is the index link thumb. An alternate thumbnail can be specified by providing its URL path in the indexThumbSource option. The thumbnails will be shown at their native size, unless modified by the maxIndexThumbSize option.

I'm going to need the idiot's guide to your test page and a detailed walk-through of what to look for and where to look for it in order to give more meaningful assistance.
Member
Registered: Mar 2009
Posts: 42
Location: UK
How extremely odd! The page should look like this:

User posted image
The image with the sub-floatbox link that doesn't show indexlinks in the group's floatbox is the one with a woman and a baby in a high chair in the top row. It all shows up perfectly in Firefox and IE 8 here, and I'm in France and the server is in Germany (I think)...

The link to the subgroup is in the bottom caption of the floatbox of this picture.

There is an annotation at the start of the page code I'm interested in, that contains the text:

"<!-- main photo and floatbox info goes here -->"

which may assist in locating my area of query, even if it doesn't display. :'(
Administrator
Registered: Aug 2008
Posts: 3382
The page is working fine for me now this time around. I've no idea why it wasn't loading correctly earlier.

The link in the caption is not a floatboxed link - that is, it does not have class="floatbox" assigned, nor is it inheriting that class from a containing element. You do have data-fb-options set on that link, and you have assigned "floatbox" to the className option, but this is not the same as setting a class attribute on the link.

I will again suggest you just use standard floatbox links to define your gallery and let Floatbox do its thing. I think you're over-thinking things and feeling a need to reinvent the wheel and construct your own unique mechanisms for showing Floatbox galleries. Or perhaps just guessing at how you think the tool might work, throwing some markup to it, and hoping for the best. Keep it simple. Follow the instructions. Floatbox just needs simple markup. It starts by finding the "floatbox" class, so get started by assigning that.
Member
Registered: Mar 2009
Posts: 42
Location: UK
I feel slightly unfairly chastised for the first time from you.

I have not attempted to re-invent the wheel or do anything not recommended. I have only used class="floatbox" on anchors or containing elements and set various data-fb-options...

I'd thought that by putting the floatbox class on one of the containing divs of the whole shebang, it would get inherited by everything - this appeared to work with all the basic images, but now that seems to be wrong.

I don't understand your assertion that I have assigned "floatbox" to the className option? Does this happen implicitly by giving the containing div that class? I've not done it specifically otherwise.

So are you telling me that the best way to launch a new floatbox group in the same box from within an existing group is NOT by putting a link to the first image in the new group in the caption of the master image? Should I be using the 'info' construct instead?

David :|
Administrator
Registered: Aug 2008
Posts: 3382
Oh, yes, you're right, the className option got set by the Floatbox code when the caption link was down on the page inside the class="floatbox" div.

To be honest, I don't know what the inheritance behaviour is when you take the caption out of the containing div and move it into the floatbox's caption area. I know that at that point it no longer resides in the containing div and so we should not be surprised if it does not inherit the class from it's ex-parent.

I'll continue to urge you to keep it simple and standard. Put class="floatbox" on that caption link to ensure it's a standard floatboxed link when in the caption panel. Put a group:abc option on that link that matches the group option placed on other links if you want a gallery set. Use numIndexLinks:-1 if you want to show index links in the resulting gallery set. If you want popup thumbnails to show on those index links then either put thumbnails (<img> elements) inside the links that comprise your gallery, or set the indexThumbSource option in each of those links.

Failure to complete any of these steps will result in further chastisement. ;)
Administrator
Registered: Aug 2008
Posts: 3382
Hold the phone! I posted the above too quickly - before my first cup of morning joe. But I'll leave that posting up as a public demonstration, and a reminder to myself, of my all-too-frequent fallibility. :)

The inheritance of the floatbox class is obviously being retained after the transfer of the link into the caption area. We can tell because the floatbox behaviour is occurring when clicking that link. I was distracted by thinking you were starting the box with an fb.start call as reported earlier.

You are using sameBox:true in your options. Your secondary gallery set cannot re-configure that box but must use it as it finds it. There's no index links on that box because it was not started with index links. You can't pop them in later after the box is created, just like you can't alter its colors, layout, etc. sameBox means sameBox and that's the box you get.

Page: 1