Would it make sense to expand the scope of Image Lightbox to .xcontent rather than #xwikicontent

Hi everyone,

There are cases where users may want to trigger an Image Lightbox on images that are part of the document header. For instance: on this page containing a header image, in case an image modal were present (there is none on this example, it’s just for illustration purpose), the user would expect to cycle through all images including the one in the header, since it can be considered as “content” indeed.

I’m trying to implement this scenario for an application and I was wondering if it would make sense more generally to expand the default scope of the Image Lightbox to .xcontent rather than the current #xwikicontent or if you see any downside with this approach?

Related Jira issue that I created too early in the process: [XWIKI-19627] Expand Lightbox scope to also include images in the document title area - XWiki.org JIRA

Cheers & Thanks


I think the opposite can be said and is more common: users would not expect to cycle through it since it’s in the header and not in the content. Also in your example I don’t see why a user would expect to cycle through it (especially since it’s already large), could you explain?

There are several reasons why cycling could maybe not be optimal:

  • it has no caption
  • it has no image id since it’s not part of the content (or does it?)
  • it has no generated anchor

Basically most (if not all) of the features of the lightbox will not be available. This is why I’m wondering why the user needs to have the header image in the lightbox cycling.

PS: I’m not saying that we cannot do it (it would need to be optional and that’s another issue, the more config option the harder to maintain, document and use for our users), but I’m curious to better understand the need.


Thank you for your answer.

Probably true indeed in many cases.

I created XWIKI-19664 to cover the generic need to open an Image Lightbox for other images than the ones in the page content, which could be a way to implement the need I’m describing more generically. Hence closing [XWIKI-19627] Expand Lightbox scope to also include images in the document title area - XWiki.org JIRA as “Won’t do”.

The header image is large on desktop, not on mobile (and in the future the user may want to zoom into the image if the feature gets implemented). On this specific example (which is a rather common layout imho), as a user, I would prefer to cycle through all images in a single modal because they all illustrate the article as a whole, even though there is one that is promoted to the top, rather than opening two distinct ones (one for the header image(s), one for the content images). In other contexts though (eg social network profile pages), two distinct modals are preferrable.

I agree it’s risky to make assumptions on what img elements outside the content should contain (eg id attribute indeed), so probably better to let developers configure themselves an Image Lightbox modal for other parts than the default #xwikicontent when they encounter the need, by implementing XWIKI-19664 if it makes sense indeed.

For the specific use case I’m describing (single modal for all images in .xwikicontent) this would mean ideally having a way to activate the Lightbox Application with the ability to deactivate or override the default behaviour implemented for images located in #xwikicontent.