0 Votes

Changes for page AutoGallery

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

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

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,11 +1,12 @@
1 1  {{velocity}}
2 -#set ($doc = $xwiki.getDocument($doc.fullName))
3 -#set ($attachments = $doc.getAttachmentList())
2 +#set($attachments = $doc.getAttachmentList())
4 4  
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}]]
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
8 8   #end
9 9  #end
10 +{{/gallery}}
10 10  {{/velocity}}
11 11  
Macro visibility
... ... @@ -1,1 +1,0 @@
1 -Current Wiki
Cached
... ... @@ -1,1 +1,1 @@
1 -Yes
1 +No
Macro content type
... ... @@ -1,0 +1,1 @@
1 +Unknown