There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-683b26fa-a7c9-4a34-8cab-be4c6aaa847e XWIKI-24030 Open

Support captions for the gallery macro images

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-d4147431-f751-4b26-9c6c-98d199e69d72 Charpentier Lucas on 19/Feb/26 14:36
 

IMO the best way to implement that would be to use a custom data attribute. If the custom data attribute is found on the pictures given, the gallery macro generates a <figure> to wrap the image in, and adds the <figcaption> node next to it.

IMO that's enough for a first implementation.
On XWIKI-6762 it was mentionned that we could provide finer controls for the caption position, but IMO this is very use-case reliant and I don't think we should add other custom data attributes to support this kind of customization.

An alternative solution would be to make a better picker for images in the gallery macro, where you can select an alt, a caption, and whatever display option we might want... But it would take more time to do and be more complex (meaning more debugging later...).