Änderungen von Dokument Excerpt Macro

Zuletzt geändert von xwikiadmin am 2025/01/07 12:27

Von Version 6.1
bearbeitet von xwikiadmin
am 2025/01/07 12:27
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.25.4]
Auf Version 2.1
bearbeitet von xwikiadmin
am 2022/08/11 17:13
Änderungskommentar: Migrated property [defaultCategories] from class [XWiki.WikiMacroClass]

Zusammenfassung

Details

Seiteneigenschaften
Inhalt
... ... @@ -1,18 +1,16 @@
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 instance {{code language="none"}}{{excerpt-include}}{{/code}}.
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 7  |=Parameter|=Description|=Default
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
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 a table 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 named hidden 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]
Makro-Code
... ... @@ -1,22 +1,16 @@
1 1  {{velocity}}
2 -#macro (executeMacro)
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 -
9 - {{wikimacrocontent /}}
10 -
11 - #else{{wikimacrocontent /}}#end##
12 - #end##
2 +## BLOCK / INLINE
3 +#set($outputType = $wikimacro.parameters.get('atlassian-macro-output-type'))
4 +#set($hidden = $wikimacro.parameters.get('hidden'))
5 +#set($displayAsBlock = "$!outoutType" == '' && $outputType.toLowerCase() == 'block')
6 +#if("$!hidden" == 'true')
7 + (% class="hidden" %)
13 13  #end
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 -## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
16 -## don't have view right on those pages.
17 -#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))
18 -#executeMacro##
19 -#else
20 - {{missingLicenseMessage extensionName="proMacros.extension.name"/}}
9 +#if($displayAsBlock)
10 + (((
21 21  #end
12 + $xcontext.macro.content
13 +#if($displayAsBlock)
14 + )))
15 +#end
22 22  {{/velocity}}
Makroinhaltstyp
... ... @@ -1,1 +1,0 @@
1 -Wiki
Standardkategorie
... ... @@ -1,0 +1,1 @@
1 +content
Makrobeschreibung
... ... @@ -1,1 +1,1 @@
1 -Excerpt macro. It marks part of the page's content for use by other macros. It is compatible with the Confluence Excerpt macro.
1 +Bridge for the Confluence Excerpt macro. It marks part of the page's content for use by other macros.
XWiki.WikiMacroParameterClass[0]
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
XWiki.WikiMacroParameterClass[1]
Parameter-Beschreibung
... ... @@ -1,1 +1,0 @@
1 -Whether the excerpt should be hidden from the page
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
XWiki.WikiMacroParameterClass[2]
Parameter-Name
... ... @@ -1,1 +1,0 @@
1 -name
Parameter-Beschreibung
... ... @@ -1,1 +1,0 @@
1 -The name of the excerpt, for named includes.
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
XWiki.WikiMacroParameterClass[3]
Parameter-Vorgabe
... ... @@ -1,1 +1,0 @@
1 -false
Parameter-Name
... ... @@ -1,1 +1,0 @@
1 -allowUnprivilegedInclude
Parameter-Beschreibung
... ... @@ -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-Typ
... ... @@ -1,1 +1,0 @@
1 -java.lang.Boolean
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein