0 Votes

Changes for page AutoGallery

Last modified by Ryan C on 2025/06/17 16:30

From version 3.16
edited by Ryan C
on 2025/06/17 16:27
Change comment: There is no comment for this version
To version 2.1
edited by Ryan C
on 2025/06/17 16:06
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Cached
... ... @@ -1,1 +1,1 @@
1 -No
1 +Yes
Macro code
... ... @@ -1,12 +1,11 @@
1 1  {{velocity}}
2 -#set($attachments = $doc.getAttachmentList())
2 +#set ($doc = $xwiki.getDocument($doc.fullName))
3 +#set ($attachments = $doc.getAttachmentList())
3 3  
4 -{{gallery}}
5 -#foreach($attachment in $attachments)
6 - #if($attachment.filename.endsWith(".jpg") || $attachment.filename.endsWith(".png") || $attachment.filename.endsWith(".webp"))
7 - image:$attachment.filename
5 +#foreach ($att in $attachments)
6 + #if ($att.filename.endsWith(".jpg") || $att.filename.endsWith(".jpeg") || $att.filename.endsWith(".png") || $att.filename.endsWith(".gif"))
7 + image: [[~${doc.fullName}@${att.filename}]]
8 8   #end
9 9  #end
10 -{{/gallery}}
11 11  {{/velocity}}
12 12  
Macro content type
... ... @@ -1,1 +1,0 @@
1 -Unknown
Macro visibility
... ... @@ -1,0 +1,1 @@
1 +Current Wiki