Modifications pour le document Expand
Modifié par superadmin le 21/07/2025 - 08:55
Résumé
-
Propriétés de la Page (2 modifications, 0 ajouts, 0 suppressions)
-
Objets (3 modifications, 0 ajouts, 0 suppressions)
Détails
- Propriétés de la Page
-
- Parent
-
... ... @@ -1,1 +1,1 @@ 1 - Confluence.Macros1 +WebHome - Contenu
-
... ... @@ -3,8 +3,9 @@ 3 3 = Parameters = 4 4 5 5 |=Parameter|=Description|=Required|=Default 6 -|**title**|Text displayed on the collaspse toggle|No| Click here to expand...6 +|**title**|Text displayed on the collaspse toggle|No|(empty) 7 7 8 +Note: if no title is provided, the title of the first panel or the first header appearing in the content will be used. if there is no such header or panel title, "Click here to expand…" will be used. 8 8 9 9 = Example Usage = 10 10
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -8,8 +8,9 @@ 8 8 transform: rotate(90deg); 9 9 } 10 10 11 -.confluence-expand-macro .panel-title 11 +.confluence-expand-macro .panel-title{ 12 12 padding: @panel-heading-padding; 13 + display: block; 13 13 } 14 14 15 15 .confluence-expand-macro .panel-body {
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -1,15 +1,21 @@ 1 1 {{velocity output="false"}} 2 2 #macro (executeMacro) 3 - $xwiki.ssx.use('Confluence.Macros.Expand') 4 - #set ($opened = $xcontext.action == 'edit') 5 - 3 + #set ($discard = $xwiki.ssx.use('Confluence.Macros.Expand')) 4 + #set ($opened = $xcontext.action == 'edit' || $xcontext.action == 'export') 6 6 {{html clean="false" wiki="true"}} 7 7 <details class="confluence-expand-macro panel panel-default" #if ($opened)open#end> 8 8 <summary> 9 - < divclass="panel-title">8 + <span class="panel-title"> 10 10 <span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> 11 - $services.rendering.escape($escapetool.xml("${wikimacro.parameters.title}"), 'xwiki/2.1') 12 - </div> 10 + #set ($title = $wikimacro.parameters.title) 11 + #if ("$!title" == "") 12 + #set ($title = $services.promacroexpand.getAutoTitle($wikimacro.content, $xwiki.currentContentSyntaxId)) 13 + #if ("$!title" == "") 14 + #set ($title = $services.localization.render("rendering.macro.expand.defaultexpandtitle")) 15 + #end 16 + #end 17 + $services.rendering.escape($escapetool.xml($title), $xwiki.currentContentSyntaxId) 18 + </span> 13 13 </summary> 14 14 <div class="panel-body"> 15 15 ... ... @@ -25,7 +25,7 @@ 25 25 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 26 26 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 27 27 ## don't have view right on those pages. 28 -#if ($services.licensing. licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))34 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 29 29 #executeMacro 30 30 #else 31 31 {{missingLicenseMessage extensionName="proMacros.extension.name"/}}
- XWiki.WikiMacroParameterClass[0]
-
- Valeur par défaut du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -Click here to expand...