Changes for page InfoboxStyles
Last modified by Mads Pedersen on 2026/07/28 06:53
From version 8.9
edited by Mads Pedersen
on 2026/01/20 14:54
on 2026/01/20 14:54
Change comment:
There is no comment for this version
To version 8.15
edited by Mads Pedersen
on 2026/01/20 16:19
on 2026/01/20 16:19
Change comment:
There is no comment for this version
Summary
-
Objects (5 modified, 0 added, 0 removed)
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,32 +1,40 @@ 1 1 {{velocity}} 2 2 {{html clean="false"}} 3 -<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 +<div style="float:right; width:$xcontext.macro.params.width; margin:0 0 1em 1em; border:1px solid #aaa; background:#f8f9fa; font-size:0.9em; font-family: sans-serif; line-height: 1.5; box-shadow: 0 2px 4px rgba(0,0,0,0.1);"> 4 4 <table style="width:100%; border-collapse:collapse;"> 5 + ## Header 5 5 #if($xcontext.macro.params.title && "$!xcontext.macro.params.title" != "") 6 - <caption style="background:#e 5e5e5; font-weight:bold; padding:8px; border:1px solid #aaa; border-bottom:none; color: #333;">7 + <caption style="background:#eeeeee; font-weight:bold; padding:10px; border:1px solid #aaa; border-bottom:none; color: #000;"> 7 7 $xcontext.macro.params.title 8 8 </caption> 9 9 #end 10 10 12 + ## Image 11 11 #if($xcontext.macro.params.image && "$!xcontext.macro.params.image" != "") 12 12 <tr> 13 - <td colspan="2" style="text-align:center; padding: 4px;">15 + <td colspan="2" style="text-align:center; padding:8px; background: #fff;"> 14 14 <img src="$xcontext.macro.params.image" style="max-width:100%; height:auto; display:block; margin: 0 auto;"> 15 15 #if($xcontext.macro.params.caption && "$!xcontext.macro.params.caption" != "") 16 - <div style="font-size:0. 85em; color:#555; padding:4px0;">$xcontext.macro.params.caption</div>18 + <div style="font-size:0.9em; color:#666; padding-top: 6px; font-style: italic;">$xcontext.macro.params.caption</div> 17 17 #end 18 18 </td> 19 19 </tr> 20 20 #end 21 21 22 - #set($content = $xcontext.macro.params.data) 23 - #if($content && "$!content" != "") 24 - #foreach($line in $content.split("\r?\n")) 25 - #if($line.contains("=") && "$!line.trim()" != "") 26 - #set($parts = $line.split("=", 2)) 24 + ## Parse the Macro Content (The big box) 25 + #set($macroContent = $xcontext.macro.content) 26 + #if($macroContent && "$!macroContent.trim()" != "") 27 + #foreach($line in $macroContent.split("\n")) 28 + #set($trimmedLine = $line.trim()) 29 + #if($trimmedLine.contains("=") && $trimmedLine.length() > 2) 30 + #set($parts = $trimmedLine.split("=", 2)) 27 27 <tr> 28 - <th style="border-top:1px solid #aaa; padding:6px; text-align:left; background:#f2f2f2; width:35%; vertical-align: top;">$parts[0].trim()</th> 29 - <td style="border-top:1px solid #aaa; padding:6px; vertical-align: top;">$parts[1].trim()</td> 32 + <th style="border-top:1px solid #ddd; padding:8px; text-align:left; background:#f9f9f9; width:35%; vertical-align: top; font-weight: 600;"> 33 + $parts[0].trim() 34 + </th> 35 + <td style="border-top:1px solid #ddd; padding:8px; vertical-align: top; background: #fff;"> 36 + $parts[1].trim() 37 + </td> 30 30 </tr> 31 31 #end 32 32 #end - Content description (Not applicable for "No content" type)
-
... ... @@ -1,0 +1,1 @@ 1 +Write lines into the infobox like "Label=Example text" - Macro content availability
-
... ... @@ -1,1 +1,1 @@ 1 - No content1 +Mandatory
- XWiki.WikiMacroParameterClass[0]
-
- Parameter order property
-
... ... @@ -1,1 +1,1 @@ 1 -1 31 +10
- XWiki.WikiMacroParameterClass[1]
-
- Parameter order property
-
... ... @@ -1,1 +1,1 @@ 1 -1 21 +11
- XWiki.WikiMacroParameterClass[2]
-
- Parameter order property
-
... ... @@ -1,1 +1,1 @@ 1 -1 11 +12
- XWiki.WikiMacroParameterClass[3]
-
- Parameter default value
-
... ... @@ -1,0 +1,1 @@ 1 +18 - Parameter description
-
... ... @@ -1,1 +1,1 @@ 1 - Writelines into theinfoboxlike "Label=Example text"1 +The width of the box - Parameter name
-
... ... @@ -1,1 +1,1 @@ 1 -d ata1 +width - Parameter order property
-
... ... @@ -1,1 +1,0 @@ 1 -10 - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -TextArea