Änderungen von Dokument Excerpt Macro
Zuletzt geändert von xwikiadmin am 2025/01/07 11:39
Von Version 3.1
bearbeitet von xwikiadmin
am 2023/04/25 10:54
am 2023/04/25 10:54
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.7.1]
Auf Version 6.1
bearbeitet von xwikiadmin
am 2025/01/07 11:39
am 2025/01/07 11:39
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.25.4]
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
-
Objekte (3 geändert, 2 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -1,16 +1,18 @@ 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. 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 instance {{code language="none"}}{{excerpt-include}}{{/code}}. 4 4 5 5 = Parameters = 6 6 7 7 |=Parameter|=Description|=Default 8 -|**atlassian-macro-output-type**|The ouput type. It can be either BLOCK or INLINE.|INLINE 8 +|**atlassian-macro-output-type**|The ouput type. It can be either BLOCK or INLINE. Here for historical reasons and won't be shown in the macro editor.|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 10 10 11 11 = Example of usage = 12 12 13 -Example of excerpt with HTML:15 +Example of excerpt with a table in it: 14 14 15 15 {{code}} 16 16 {{excerpt}} ... ... @@ -19,7 +19,7 @@ 19 19 {{/excerpt}} 20 20 {{/code}} 21 21 22 -The result is the following 24 +The result is the following: 23 23 24 24 {{excerpt}} 25 25 |=Title1|=Title2|=Title3 ... ... @@ -26,16 +26,38 @@ 26 26 |Text1|Text2|Text3 27 27 {{/excerpt}} 28 28 29 -Example of hidden excerpt 31 +Example of named hidden excerpt: 30 30 31 31 {{code}} 32 -{{excerpt hidden="true"}} 34 +{{excerpt hidden="true" name="myexcerpt"}} 33 33 My hidden content. 34 34 {{/excerpt}} 35 35 {{/code}} 36 36 37 -The result is the following 39 +The result is the following: 38 38 39 -{{excerpt hidden="true"}} 41 +{{excerpt hidden="true" name="myexcerpt"}} 40 40 My hidden content. 41 41 {{/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]
-
- Makro-Code
-
... ... @@ -1,33 +1,22 @@ 1 -{{velocity output="false"}}1 +{{velocity}} 2 2 #macro (executeMacro) 3 - ## BLOCK / INLINE 4 - #set($outputType = $wikimacro.parameters.get('atlassian-macro-output-type')) 5 5 #set($hidden = $wikimacro.parameters.get('hidden')) 6 - #set($displayAsBlock = "$!outputType" != '' && $outputType.toLowerCase() == 'block') 7 - #if("$!hidden" == 'true') 8 - (% class="hidden" %) 9 - #end 10 - #if($displayAsBlock) 11 - ((( 12 - #end 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 + 13 13 {{wikimacrocontent /}} 14 - #if($displayAsBlock) 15 - ))) 16 - #end 17 -#end 18 -{{/velocity}} 19 19 20 - {{includereference="Licenses.Code.VelocityMacros"/}}21 - 22 - {{velocity}}11 + #else{{wikimacrocontent /}}#end## 12 + #end## 13 +#end 23 23 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 24 24 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 25 25 ## don't have view right on those pages. 26 -#if ($services.licensing. licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))27 - 17 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 18 +#executeMacro## 28 28 #else 29 - {{error}} 30 - #getMissingLicenseMessage('proMacros.extension.name') 31 - {{/error}} 20 + {{missingLicenseMessage extensionName="proMacros.extension.name"/}} 32 32 #end 33 33 {{/velocity}} - Standardkategorie
-
... ... @@ -1,1 +1,0 @@ 1 -content - Makrobeschreibung
-
... ... @@ -1,1 +1,1 @@ 1 - Bridge for the ConfluenceExcerpt macro. It marks part of the page's content for use by other macros.1 +Excerpt macro. It marks part of the page's content for use by other macros. It is compatible with the Confluence Excerpt macro.
- XWiki.WikiMacroParameterClass[0]
-
- Parameter verpflichtend
-
... ... @@ -1,0 +1,1 @@ 1 +Nein
- XWiki.WikiMacroParameterClass[1]
-
- Parameter-Beschreibung
-
... ... @@ -1,0 +1,1 @@ 1 +Whether the excerpt should be hidden from the page - Parameter verpflichtend
-
... ... @@ -1,0 +1,1 @@ 1 +Nein
- XWiki.WikiMacroParameterClass[2]
-
- Parameter-Name
-
... ... @@ -1,0 +1,1 @@ 1 +name - Parameter-Beschreibung
-
... ... @@ -1,0 +1,1 @@ 1 +The name of the excerpt, for named includes. - Parameter verpflichtend
-
... ... @@ -1,0 +1,1 @@ 1 +Nein
- XWiki.WikiMacroParameterClass[3]
-
- Parameter-Vorgabe
-
... ... @@ -1,0 +1,1 @@ 1 +false - Parameter-Name
-
... ... @@ -1,0 +1,1 @@ 1 +allowUnprivilegedInclude - Parameter-Beschreibung
-
... ... @@ -1,0 +1,1 @@ 1 +Allow this excerpt to be seen even for people who don't have view rights on this page when included - Parameter-Typ
-
... ... @@ -1,0 +1,1 @@ 1 +java.lang.Boolean - Parameter verpflichtend
-
... ... @@ -1,0 +1,1 @@ 1 +Nein