Hi.
I’m trying to write a small macro listing all attachments of the document where the macro is inserted. My code so far:
{{velocity}}
##$doc
#foreach($attachment in $doc.getAttachmentList())
* [[$attachment.getFilename()>>attach:$attachment.getFilename()]]
#end
{{/velocity}}
Funny thing is: As long as I am editing and just inserting this macro with the WYSIWYG editor I can see all attachments of the article I am editing. But after saving and viewing the list is empty.
For debugging I inserted that line
$doc
This is switching from the current article to Main.WebHome
when I saved + viewed it.
Why is this happening and how to avoid this?
Regards, Simpel