Changes for page InfoboxStyles

Last modified by Mads Pedersen on 2026/07/28 06:53

From version 7.1
edited by Mads Pedersen
on 2026/01/20 14:36
Change comment: There is no comment for this version
To version 8.4
edited by Mads Pedersen
on 2026/01/20 14:44
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,0 +1,3 @@
1 +{{wikibox title="Test" caption="Test" data="line1=This is some tekst"}}{{/wikibox}}
2 +
3 +
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,12 +1,14 @@
1 1  {{html clean="false"}}
2 2  <div style="float:right; width:280px; margin:0 0 1em 1em; border:1px solid #aaa; background:#f8f9fa; font-size:0.9em; font-family: sans-serif; line-height: 1.4;">
3 3   <table style="width:100%; border-collapse:collapse;">
4 - #if($xcontext.macro.params.title)
4 + #if($xcontext.macro.params.title && "$!xcontext.macro.params.title" != "")
5 5   <caption style="background:#e5e5e5; font-weight:bold; padding:8px; border:1px solid #aaa; border-bottom:none; color: #333;">
6 6   $xcontext.macro.params.title
7 7   </caption>
8 8   #end
9 - #if($xcontext.macro.params.image)
9 +
10 + ## Only show this row if an image URL is provided
11 + #if($xcontext.macro.params.image && "$!xcontext.macro.params.image" != "")
10 10   <tr>
11 11   <td colspan="2" style="text-align:center; padding:4px;">
12 12   <img src="$xcontext.macro.params.image" style="max-width:100%; height:auto; display:block; margin: 0 auto;">
... ... @@ -18,10 +18,10 @@
18 18   #end
19 19  
20 20   #set($content = $xcontext.macro.params.data)
21 - #if($content)
23 + #if($content && "$!content" != "")
22 22   ## Split content by newlines and handle each line
23 23   #foreach($line in $content.split("\r?\n"))
24 - #if($line.contains("="))
26 + #if($line.contains("=") && "$!line.trim()" != "")
25 25   #set($parts = $line.split("=", 2))
26 26   <tr>
27 27   <th style="border-top:1px solid #aaa; padding:6px; text-align:left; background:#f2f2f2; width:35%; vertical-align: top;">$parts[0].trim()</th>
Macro content type
... ... @@ -1,1 +1,1 @@
1 -Wiki
1 +Velocity
Macro id
... ... @@ -1,0 +1,1 @@
1 +wikibox
Macro visibility
... ... @@ -1,1 +1,1 @@
1 -Global
1 +Current Wiki