With reference to the macro/velocity script specified on this page:
Specifically,
{{velocity}}
#set ($attachments = $doc.attachmentList)
#if ($attachments.size() > 0)
{{gallery}}
#foreach($attachment in $attachments)
#if($attachment.isImage())
image:$attachment.filename
#end
#end
{{/gallery}}
#end
{{/velocity}}
If the attached image file names have spaces in them, this script does not work as it cannot load the files. How can this script be modified to accept attachment file names with spaces? For example, is it possible to urlencode the string $attachment.filename
? Is there a different syntax that can be used for image:
?
update: I am messing around with the manually specifying the image names, ala:
{{gallery}}
image:halloween%20-%201.jpg
image:halloween - 2.jpg
{{/gallery}}
In the first instance, the site tries to load halloween%2520-%25201.jpg
– in other words, it double-encodes the filename. In the second instance, xwiki tries to load halloween
– it doesn’t understand spaces.
That means my idea of urlencoding, above, is not a solution. Is there any way to specify attachments with spaces to image:? A look at the Xwiki Syntax 2 document does not indicate any method of so doing, all examples are spaceless filenames. http://platform.xwiki.org/xwiki/bin/view/XWiki/XWikiSyntax?syntax=2.0
Thanks.