Changes for page Excerpt Macro
Last modified by Yana Oksner on 2025/10/02 15:35
From version 3.1
edited by Yana Oksner
on 2024/12/03 16:51
on 2024/12/03 16:51
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.25.1]
To version 2.1
edited by Yana Oksner
on 2024/02/23 13:49
on 2024/02/23 13:49
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.15.0]
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (3 modified, 0 added, 2 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,6 +1,6 @@ 1 1 = Description = 2 2 3 -The Excerpt macro is a bridge between Confluence and XWiki. It allows the user to mark part of the page's content for use by other macros , for exemple {excerpt-include}}.3 +The Excerpt macro is a bridge between Confluence and XWiki. It allows the user to mark part of the page's content for use by other macros. 4 4 5 5 = Parameters = 6 6 ... ... @@ -7,12 +7,10 @@ 7 7 |=Parameter|=Description|=Default 8 8 |**atlassian-macro-output-type**|The ouput type. It can be either BLOCK or INLINE.|INLINE 9 9 |**hidden**|If true, the content of the macro will be hidden.|false 10 -|**name**|The name of the excerpt, for named includes.|false 11 -|**allowUnprivilegedInclude**|Allow this excerpt to be seen even for people who don't have view rights on this page when included|false 12 12 13 13 = Example of usage = 14 14 15 -Example of excerpt with atable in it:13 +Example of excerpt with HTML : 16 16 17 17 {{code}} 18 18 {{excerpt}} ... ... @@ -21,7 +21,7 @@ 21 21 {{/excerpt}} 22 22 {{/code}} 23 23 24 -The result is the following: 22 +The result is the following : 25 25 26 26 {{excerpt}} 27 27 |=Title1|=Title2|=Title3 ... ... @@ -28,38 +28,16 @@ 28 28 |Text1|Text2|Text3 29 29 {{/excerpt}} 30 30 31 -Example of namedhidden excerpt:29 +Example of hidden excerpt : 32 32 33 33 {{code}} 34 -{{excerpt hidden="true" name="myexcerpt"}}32 +{{excerpt hidden="true"}} 35 35 My hidden content. 36 36 {{/excerpt}} 37 37 {{/code}} 38 38 39 -The result is the following: 37 +The result is the following : 40 40 41 -{{excerpt hidden="true" name="myexcerpt"}}39 +{{excerpt hidden="true"}} 42 42 My hidden content. 43 43 {{/excerpt}} 44 - 45 -(yes, nothing, this is intended!) 46 - 47 -Let's include this hidden excerpt: 48 - 49 -{{code}} 50 -{{excerpt-include 0="Excerpt" name="myexcerpt"/}} 51 -{{/code}} 52 - 53 -Result: 54 - 55 -{{excerpt-include 0="Excerpt" name="myexcerpt"/}} 56 - 57 -Without the panel: 58 - 59 -{{code}} 60 -{{excerpt-include 0="Excerpt" name="myexcerpt" nopanel="true"/}} 61 -{{/code}} 62 - 63 -Result: 64 - 65 -{{excerpt-include 0="Excerpt" name="myexcerpt" nopanel="true"/}}
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,21 +1,28 @@ 1 -{{velocity}} 1 +{{velocity output="false"}} 2 2 #macro (executeMacro) 3 + ## BLOCK / INLINE 4 + #set($outputType = $wikimacro.parameters.get('atlassian-macro-output-type')) 3 3 #set($hidden = $wikimacro.parameters.get('hidden')) 4 - #if("$!hidden" != 'true') 5 - #set($outputType = $wikimacro.parameters.get('atlassian-macro-output-type')) 6 - #set($displayAsBlock = "$!outputType" != '' && $outputType.toLowerCase() == 'block') 7 - #if ($displayAsBlock) 8 - 6 + #set($displayAsBlock = "$!outputType" != '' && $outputType.toLowerCase() == 'block') 7 + #if("$!hidden" == 'true') 8 + (% class="hidden" %) 9 + #end 10 + #if($displayAsBlock) 11 + ((( 12 + #end 9 9 {{wikimacrocontent /}} 10 - 11 - #else{{wikimacrocontent /}}#end##12 - #end ##14 + #if($displayAsBlock) 15 + ))) 16 + #end 13 13 #end 18 +{{/velocity}} 19 + 20 +{{velocity}} 14 14 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 15 15 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 16 16 ## don't have view right on those pages. 17 -#if ($services. promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))18 -#executeMacro ##24 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 25 + #executeMacro 19 19 #else 20 20 {{missingLicenseMessage extensionName="proMacros.extension.name"/}} 21 21 #end
- XWiki.WikiMacroParameterClass[0]
-
- Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No
- XWiki.WikiMacroParameterClass[1]
-
- Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Whether the excerpt should be hidden from the page - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No
- XWiki.WikiMacroParameterClass[2]
-
- Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -The name of the excerpt, for named includes. - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -name
- XWiki.WikiMacroParameterClass[3]
-
- Parameter default value
-
... ... @@ -1,1 +1,0 @@ 1 -false - Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Allow this excerpt to be seen even for people who don't have view rights on this page when included - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -allowUnprivilegedInclude - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -java.lang.Boolean