0 Votes

Changes for page SubmitIncidentMacro

Last modified by Ryan C on 2025/06/08 05:22

From version 2.8
edited by Ryan C
on 2025/06/08 03:46
Change comment: There is no comment for this version
To version 2.9
edited by Ryan C
on 2025/06/08 03:48
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -15,13 +15,17 @@
15 15   #end
16 16  #end
17 17  
18 -## Build incident block line by line
18 +## Build incident block
19 19  #set($block = "(% style=\"margin-bottom:20px; width:100%\" %)\n")
20 -#set($block = "${block}|[[image:${resolvedImage}||data-xwiki-image-style=\"thumbnail-clickable\" style=\"border:1px solid #ccc\" width=\"200\"]]| \n")
20 +#if ($resolvedImage && $resolvedImage != "")
21 + #set($block = "${block}|[[image:${resolvedImage}||data-xwiki-image-style=\"thumbnail-clickable\" style=\"border:1px solid #ccc\" width=\"200\"]]| \n")
22 +#else
23 + #set($block = "${block}|No image provided.| \n")
24 +#end
21 21  #set($block = "${block}\n=== [[$headline>>$url]] ===\n\n")
22 22  #set($block = "${block}$desc\n[[Read More>>$url]]")
23 23  
24 -## Append to current page
28 +## Append to current document
25 25  #set($doc = $xwiki.getDocument($doc.fullName))
26 26  #set($content = $doc.getContent())
27 27  $doc.setContent("${content}\n\n${block}")