Changes for page InfoboxStyles
Last modified by Mads Pedersen on 2026/07/28 06:53
From version 4.1
edited by Mads Pedersen
on 2026/01/20 14:29
on 2026/01/20 14:29
Change comment:
There is no comment for this version
To version 8.13
edited by Mads Pedersen
on 2026/01/20 15:00
on 2026/01/20 15:00
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 3 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,0 +1,3 @@ 1 +{{wikibox title="Test" data="line1=TTesting"/}} 2 + 3 +
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,21 +1,45 @@ 1 +{{velocity}} 1 1 {{html clean="false"}} 2 -<div class="xwiki-infobox"> 3 - <table> 4 - <caption>$escapetool.xml($!parameters.title)</caption> 5 - #if("$!parameters.image" != "") 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.5; box-shadow: 0 2px 4px rgba(0,0,0,0.1);"> 4 + <table style="width:100%; border-collapse:collapse;"> 5 + ## Header 6 + #if($xcontext.macro.params.title && "$!xcontext.macro.params.title" != "") 7 + <caption style="background:#eeeeee; font-weight:bold; padding:10px; border:1px solid #aaa; border-bottom:none; color: #000;"> 8 + $xcontext.macro.params.title 9 + </caption> 10 + #end 11 + 12 + ## Image 13 + #if($xcontext.macro.params.image && "$!xcontext.macro.params.image" != "") 6 6 <tr> 7 - <td colspan="2" class="xwiki-infobox-image">8 - <img src="$ escapetool.xml($!parameters.image)"alt=""/>9 - #if( "$!parameters.imageCaption" != "")10 - <div class="xwiki-infobox-image-caption">$escapetool.xml($!parameters.imageCaption)</div>15 + <td colspan="2" style="text-align:center; padding:8px; background: #fff;"> 16 + <img src="$xcontext.macro.params.image" style="max-width:100%; height:auto; display:block; margin: 0 auto;"> 17 + #if($xcontext.macro.params.caption && "$!xcontext.macro.params.caption" != "") 18 + <div style="font-size:0.9em; color:#666; padding-top: 6px; font-style: italic;">$xcontext.macro.params.caption</div> 11 11 #end 12 12 </td> 13 13 </tr> 14 14 #end 15 15 16 - <!-- Rows are provided by the user in the macro body --> 17 - $!content 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)) 31 + <tr> 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> 38 + </tr> 39 + #end 40 + #end 41 + #end 18 18 </table> 19 19 </div> 20 20 {{/html}} 21 - 45 +{{/velocity}} - Content description (Not applicable for "No content" type)
-
... ... @@ -1,0 +1,1 @@ 1 +Write lines into the infobox like "Label=Example text" - Macro content type
-
... ... @@ -1,1 +1,1 @@ 1 - Wiki1 +Velocity - Macro content availability
-
... ... @@ -1,0 +1,1 @@ 1 +Mandatory - Macro id
-
... ... @@ -1,0 +1,1 @@ 1 +wikibox - Macro visibility
-
... ... @@ -1,1 +1,1 @@ 1 - Global1 +Current Wiki
- XWiki.WikiMacroParameterClass[0]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The header text of the box. - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +title - Parameter order property
-
... ... @@ -1,0 +1,1 @@ 1 +10
- XWiki.WikiMacroParameterClass[1]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +URL or attachment name for the image. - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +image - Parameter order property
-
... ... @@ -1,0 +1,1 @@ 1 +11
- XWiki.WikiMacroParameterClass[2]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +Text under the image. - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +caption - Parameter order property
-
... ... @@ -1,0 +1,1 @@ 1 +12