Wiki source code of Slideshow Macro
Version 1.1 by RPG Research Xwiki Documents Administrator on 2023/09/27 22:31
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | == Description == |
2 | |||
3 | Creates a slideshow based on a set of image references. Supports two modes: ##default## or ##pile##. In default mode, a slideshow is created from the images defined in the macro content, while in ##pile## mode, all slideshow images on the current page whose ##mode## set to ##pile## are assembled into a common slideshow. Optional captions can be added next to each image reference, or within the body of each ##slideshow## call in case of ##pile## mode. | ||
4 | |||
5 | {{warning}} | ||
6 | The syntax of this macro is still experimental at this stage and is subject to changes. Comments are welcome in the XWiki Forum or on the macro issue tracker. | ||
7 | {{/warning}} | ||
8 | |||
9 | === Usage === | ||
10 | |||
11 | ==== Default mode ==== | ||
12 | |||
13 | {{code language="none"}} | ||
14 | {{slideshow width="800px" height="400px"}} | ||
15 | gallica-btv1b10052637j-5.jpg Lorem ipsum | ||
16 | gallica-btv1b10052637j-12.jpg Dolor sit amor | ||
17 | gallica-btv1b10052637j-3.jpg Cectetur adipiscing elit | ||
18 | {{/slideshow}} | ||
19 | {{/code}} | ||
20 | |||
21 | ==== Pile mode ==== | ||
22 | |||
23 | {{code}} | ||
24 | {{slideshow images="gallica-btv1b10052637j-6.jpg" mode="pile" width="300px"}} | ||
25 | = Lorem ipsum = | ||
26 | Dolor sit amor | ||
27 | {{/slideshow}} | ||
28 | |||
29 | {{slideshow images="gallica-btv1b10052637j-4.jpg" mode="pile" width="300px"}} | ||
30 | = Cectetur adipiscing elit = | ||
31 | Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. | ||
32 | {{/slideshow}} | ||
33 | {{/code}} | ||
34 | |||
35 | === Parameters === | ||
36 | |||
37 | {{velocity}} | ||
38 | #set ($parameters = $doc.getObjects('XWiki.WikiMacroParameterClass')) | ||
39 | #set ($headers = '|=Name|=Description|=Mandatory|=Default') | ||
40 | #set ($body = '') | ||
41 | #foreach ($parameter in $parameters) | ||
42 | #set ($isMandatory = ${parameter.getProperty('mandatory').value}) | ||
43 | #if ($isMandatory == 1) #set ($isMandatory = "Yes") #else #set ($isMandatory = "No") #end | ||
44 | #set ($body = "$body|${parameter.getProperty('name').value}|(((${parameter.getProperty('description').value})))|$isMandatory|$parameter.getProperty('defaultValue').value | ||
45 | ") | ||
46 | #end | ||
47 | ## The block below is handy for generating the code to be pasted to the online extension.xwiki.org page for documenting the parameters statically (i.e. without having the macro object attached to the page). | ||
48 | #if ($request.documentation) | ||
49 | {{code}} | ||
50 | $headers | ||
51 | $body | ||
52 | {{/code}} | ||
53 | #end | ||
54 | |||
55 | $headers | ||
56 | $body | ||
57 | {{/velocity}} | ||
58 | |||
59 |