Changes for page Button
Last modified by Yana Oksner on 2026/01/08 11:01
From version 9.1
edited by Yana Oksner
on 2026/01/08 11:01
on 2026/01/08 11:01
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.29.0]
To version 7.1
edited by Yana Oksner
on 2025/07/18 12:19
on 2025/07/18 12:19
Change comment:
Migrated property [order] from class [XWiki.WikiMacroParameterClass]
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (7 modified, 0 added, 4 removed)
- XWiki.WikiMacroClass[0]
- XWiki.WikiMacroParameterClass[0]
- XWiki.WikiMacroParameterClass[1]
- XWiki.WikiMacroParameterClass[2]
- XWiki.WikiMacroParameterClass[3]
- XWiki.WikiMacroParameterClass[4]
- XWiki.WikiMacroParameterClass[5]
- XWiki.WikiMacroParameterClass[6]
- XWiki.WikiMacroParameterClass[7]
- XWiki.WikiMacroParameterClass[8]
- XWiki.WikiMacroParameterClass[9]
Details
- Page properties
-
- Content
-
... ... @@ -7,13 +7,9 @@ 7 7 |label|$services.localization.render('rendering.macro.button.parameter.label.description')|- 8 8 |url|$services.localization.render('rendering.macro.button.parameter.url.description')|- 9 9 |color|$services.localization.render('rendering.macro.button.parameter.color.description')|White 10 -|title|$services.localization.render('rendering.macro.button.parameter.title.description')|- 11 11 |width|$services.localization.render('rendering.macro.button.parameter.width.description')|- 12 12 |newTab|$services.localization.render('rendering.macro.button.parameter.newTab.description')|false 13 13 |icon|$services.localization.render('rendering.macro.button.parameter.icon.description')|- 14 -|type|$services.localization.render('rendering.macro.button.parameter.type.description')|Default 15 -|id|$services.localization.render('rendering.macro.button.parameter.id.description')|Default 16 -|class|$services.localization.render('rendering.macro.button.parameter.class.description')|Default 17 17 18 18 == Examples == 19 19 ... ... @@ -35,8 +35,4 @@ 35 35 {{code}}{{button label="Store" url="http://store.xwiki.com" color="#889cb8" newTab="true" icon="page" width="100%"/}}{{/code}} 36 36 37 37 {{button label="Store" url="http://store.xwiki.com" color="#889cb8" newTab="true" icon="page" width="100%"/}} 38 - 39 -{{code}}{{button label="Delete example" url="http://store.xwiki.com" type="DANGER"/}}{{/code}} 40 - 41 -{{button label="Delete example" url="http://store.xwiki.com" type="DANGER"/}} 42 42 {{/velocity}}
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -27,15 +27,11 @@ 27 27 #macro (executeMacro) 28 28 ## Retrieve macro parameters 29 29 #set ($label = $escapetool.xml($wikimacro.parameters.label)) 30 - #set ($title = $escapetool.xml($wikimacro.parameters.title)) 31 31 #set ($url = $escapetool.xml($wikimacro.parameters.url)) 32 32 #set ($color = $wikimacro.parameters.color) 33 33 #set ($width = $escapetool.xml($wikimacro.parameters.width)) 34 34 #set ($newTab = $escapetool.xml($wikimacro.parameters.newTab)) 35 35 #set ($icon = $escapetool.xml($xcontext.macro.params.icon)) 36 - #set ($macro.id = $wikimacro.parameters.id) 37 - #set ($macro.classParam = $wikimacro.parameters.get('class')) 38 - #set ($macro.type = $wikimacro.parameters.type) 39 39 ## Resolve the url as a Wiki Document if it exists, else assume it is an external link 40 40 #if ($xwiki.exists($url)) 41 41 #set ($url = $xwiki.getDocument($url).getURL()) ... ... @@ -47,13 +47,6 @@ 47 47 #else 48 48 #set ($colors = [255, 255, 255]) 49 49 #end 50 - #set ($macro.additionalClass = '') 51 - #if ("$!macro.classParam" != '') 52 - #set ($macro.additionalClass = "$macro.additionalClass $macro.classParam") 53 - #end 54 - #if ("$!macro.type" != '') 55 - #set ($macro.additionalClass = "$macro.additionalClass btn-$macro.type.name().toLowerCase()") 56 - #end 57 57 #set ($darkenedColors = []) 58 58 #darken($colors, $darkenedColors) 59 59 {{html clean=false}} ... ... @@ -65,29 +65,14 @@ 65 65 #if (!$wikimacro.context.isInline())<p>#end 66 66 <a href="$url" #if($newTab == 'true')target="_blank"#end> 67 67 <button 68 - #if ("$!macro.id" != '') 69 - id="$escapetool.xml($macro.id)" 70 - #end 71 - #if ("$!title" != "") 72 - title="$escapetool.xml($title)" 73 - #end 74 74 style=" 75 - #if ("$!color" != '') 76 76 background-color: #toCssRGB($colors); 77 77 border-color: #toCssRGB($darkenedColors); 78 78 color: #fontColor($colors); 79 - #end 80 80 width: $!width; 81 81 " 82 - class="btn $escapetool.xml($macro.additionalClass)"> 83 - #if ("$!icon" != "") 84 - #set ($iconHTML = "$!services.icon.renderHTML($icon)") 85 - #if ($iconHTML == "") 86 - <span class="fa fa-$escapetool.xml($icon)"></span> 87 - #else 88 - $iconHTML 89 - #end 90 - #end 63 + class="btn"> 64 + $!services.icon.renderHTML($!icon) 91 91 $label 92 92 </button> 93 93 </a> - Macro description
-
... ... @@ -1,0 +1,1 @@ 1 +Insert a button!
- XWiki.WikiMacroParameterClass[0]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The label of the button.
- XWiki.WikiMacroParameterClass[1]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +A link or a page reference.
- XWiki.WikiMacroParameterClass[2]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The color of the button.
- XWiki.WikiMacroParameterClass[3]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The width of the button specified in pixels, percentage or other valid CSS value (ex. 30px, 30%, 30em). If no value is specified, the width will be determined by the length of the label.
- XWiki.WikiMacroParameterClass[4]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +Denotes whether the page will be opened in a new page or not.
- XWiki.WikiMacroParameterClass[5]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +Icon associated with the button, placed before the label.
- XWiki.WikiMacroParameterClass[6]
-
- Parameter default value
-
... ... @@ -1,1 +1,0 @@ 1 -DEFAULT - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -type - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -com.xwiki.macros.button.ButtonType
- XWiki.WikiMacroParameterClass[7]
-
- Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -id - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -java.lang.String
- XWiki.WikiMacroParameterClass[8]
-
- Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -class - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -java.lang.String
- XWiki.WikiMacroParameterClass[9]
-
- Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -title - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -java.lang.String