Changes for page Expand
Last modified by Frank Fock on 2025/04/04 21:18
From version 4.1
edited by Frank Fock
on 2025/04/04 21:18
on 2025/04/04 21:18
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.26.14]
To version 2.1
edited by Frank Fock
on 2024/05/23 17:17
on 2024/05/23 17:17
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.17.3]
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (3 modified, 0 added, 1 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,1 @@ 1 - WebHome1 +Confluence.Macros - Content
-
... ... @@ -3,13 +3,11 @@ 3 3 = Parameters = 4 4 5 5 |=Parameter|=Description|=Required|=Default 6 -|**title**|Text displayed on the collaspse toggle|No|(empty) 7 -|**expanded**|If selected the expand will be opened automatically when loading the page.|No|False 6 +|**title**|Text displayed on the collaspse toggle|No|Click here to expand... 8 8 9 -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. 10 10 11 11 = Example Usage = 12 12 13 -{{expand expanded="false"}}14 -Hello 11 +{{expand}} 12 +Hello 👀 15 15 {{/expand}}
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -8,9 +8,8 @@ 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: flex; 14 14 } 15 15 16 16 .confluence-expand-macro .panel-body { ... ... @@ -23,10 +23,6 @@ 23 23 24 24 .confluence-expand-macro summary:hover { 25 25 cursor: pointer; 26 -} 27 - 28 -.panel-title:hover .title-text { 29 - cursor: pointer; 30 30 text-decoration: underline; 31 31 } 32 32 ... ... @@ -35,11 +35,6 @@ 35 35 border: none; 36 36 } 37 37 38 -.confluence-expand-macro.panel.panel-default .panel-body ul { 39 - list-style-type: revert; 40 - padding-left: revert; 41 -} 42 - 43 43 .confluence-expand-macro.panel { 44 44 background: unset; 45 45 }
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,45 +1,15 @@ 1 1 {{velocity output="false"}} 2 2 #macro (executeMacro) 3 - ## To avoid an issue regarding {{wikimacroparameter}} and {{wikimacrocontent}} that fail to render when in 4 - ## edit mode while inside a HTML macro, we need to manually write the HTML by using XWiki syntax. This way, 5 - ## while the macro will always be expanded when in edit mode, the user will be able to modify the text inline. 6 - #set ($targetSyntaxId = $wikimacro.context.transformationContext.targetSyntax.type.id) 7 - #set ($discard = $xwiki.ssx.use('Confluence.Macros.Expand')) 8 - #if ($targetSyntaxId == 'annotatedhtml' || $targetSyntaxId == 'annotatedxhtml' || 9 - $request.outputSyntax == 'annotatedhtml') 10 - (% class="confluence-expand-macro panel panel-default" %) 11 - ((( 12 - ((( 13 - (% class="panel-title" %) 14 - ((( 15 - (% class="glyphicon glyphicon-menu-down" aria-hidden="true" %) 16 - ((())) 17 - {{wikimacroparameter name='title' /}} 18 - ))) 19 - ))) 20 - (% class="panel-body" %) 21 - ((( 22 - {{wikimacrocontent /}} 23 - ))) 24 - ))) 25 - #else 26 - #set ($opened = $xcontext.action == 'edit' || $xcontext.action == 'export' || $wikimacro.parameters.expanded) 3 + $xwiki.ssx.use('Confluence.Macros.Expand') 4 + #set ($opened = $xcontext.action == 'edit') 5 + 27 27 {{html clean="false" wiki="true"}} 28 28 <details class="confluence-expand-macro panel panel-default" #if ($opened)open#end> 29 29 <summary> 30 - < spanclass="panel-title">9 + <div class="panel-title"> 31 31 <span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> 32 - #set ($title = $wikimacro.parameters.title) 33 - #if ("$!title" == "") 34 - #set ($title = $services.promacroexpand.getAutoTitle($wikimacro.content, $xwiki.currentContentSyntaxId)) 35 - #if ("$!title" == "") 36 - #set ($title = $services.localization.render("rendering.macro.expand.defaultexpandtitle")) 37 - #end 38 - #end 39 - <span class="title-text"> 40 - $services.rendering.escape($escapetool.xml($title), $xwiki.currentContentSyntaxId) 41 - </span> 42 - </span> 11 + $services.rendering.escape($escapetool.xml("${wikimacro.parameters.title}"), 'xwiki/2.1') 12 + </div> 43 43 </summary> 44 44 <div class="panel-body"> 45 45 ... ... @@ -48,7 +48,6 @@ 48 48 </div> 49 49 </details> 50 50 {{/html}} 51 - #end 52 52 #end 53 53 {{/velocity}} 54 54 ... ... @@ -56,7 +56,7 @@ 56 56 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 57 57 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 58 58 ## don't have view right on those pages. 59 -#if ($services. promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))28 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 60 60 #executeMacro 61 61 #else 62 62 {{missingLicenseMessage extensionName="proMacros.extension.name"/}} - Macro content availability
-
... ... @@ -1,1 +1,1 @@ 1 - Mandatory1 +Optional - Macro description
-
... ... @@ -1,0 +1,5 @@ 1 +Add the Expand macro to your page to provide content in an expandable / collapsible section. 2 + 3 +This is one of Confluence's most popular macros. It's great for: visually reducing the amount of information on a page, breaking process information down into clickable steps, hiding background or obsolete information, while still keeping it on the page for future reference. 4 + 5 +The macro is collapsed by default, people need to click each one to expand it. There's no way to expand all macros on a page at once, however all Expand macros are automatically expanded when you print or export the page to PDF.
- XWiki.WikiMacroParameterClass[0]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +Defines the text that appears next to the expand/collapse icon.
- XWiki.WikiMacroParameterClass[1]
-
- Parameter default value
-
... ... @@ -1,1 +1,0 @@ 1 -0 - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -expanded - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -java.lang.Boolean - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No