Changes for page XWiki HowTo’s

Last modified by Roman Friesen on 2009/10/03 10:51

From version Icon 2.1 Icon
edited by Roman Friesen
on 2009/09/15 11:54
Change comment: "Velocity queries" added
To version Icon 3.1 Icon
edited by Roman Friesen
on 2009/09/15 18:31
Change comment: links and translation howto added

Summary

Details

Icon Page properties
Content
... ... @@ -2,17 +2,26 @@
2 2  
3 3  {{toc start="2" numbered="true" depth="3"/}}
4 4  
5 -== Links ==
6 -
7 -* [[Changing the skin >>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Skins]]
5 +== General ==
6 +* [[Features / Applications >> http://enterprise.xwiki.org/xwiki/bin/view/Main/Features]]
8 8  * [[Advanced (Developer) guide >>http://platform.xwiki.org/xwiki/bin/view/DevGuide/]]
9 9  * [[Developer guide >>http://dev.xwiki.org/xwiki/bin/view/Main/]]
10 10  * [[Code Zone >>http://code.xwiki.org/xwiki/bin/view/Main/]]
11 -* [[wiki using API >>http://platform.xwiki.org/xwiki/bin/download/DevGuide/API/xwiki%2Dcore%2D2.0%2Drc%2D1%2Djavadoc.jar/index.html]]
12 12  
13 -== Velocity Macros ==
11 +== Skin customizing ==
12 +* [[Ad hoc CSS and JavaScript extensions >> http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial]]
13 +* [[Changing the skin >>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Skins]]
14 14  
15 -=== Some Velocity queries ===
15 +
16 +== Velocity Scripting ==
17 +
18 +* [[XWiki Velocity API >>http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting]]
19 +* [[Velocity Macros >>http://code.xwiki.org/xwiki/bin/view/Macros/]]
20 +* [[Velocity User Guide >>http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html]]
21 +* [[Include the Velocity code of another XWiki page >> http://platform.xwiki.org/xwiki/bin/view/DevGuide/IncludeInVelocity]]
22 +
23 +=== Privileges ===
24 +
16 16  * Admin rights
17 17  {{code}}
18 18  #if ($xwiki.hasAdminRights())
... ... @@ -27,17 +27,40 @@
27 27  #end
28 28  {{/code}}
29 29  
30 -* Language
39 +
40 +=== Translation of Panels ===
41 +==== With an if/else-block ====
42 +1. Put the following velocity script into your panel
31 31  {{code}}
44 +#panelheader('MyPanel')
45 +
32 32  #if ($context.language == "de")
33 - German translation is required
47 + My German translation
34 34  #elseif ($context.language == "fr")
35 - French translation is required
49 + My French translation
36 36  #else
37 - THE LANGUAGE "$context.language" IS NOT SUPPORTED.
51 + My default translation
38 38  #end
53 +
54 +#panelfooter()
39 39  {{/code}}
40 40  
57 +1. That is all :)
58 +==== Loading a translated page into the panel ====
59 +{{warning}}Maybe the macro "includeForm()" is not the best choice here, see [[including macros >> http://platform.xwiki.org/xwiki/bin/view/DevGuide/IncludeInVelocity]].{{/warning}}
60 +
61 +1. Creates a new wiki page with translated content, for example 'Main.MyMenu'.
62 +1. Include this page in your panel, for example:
63 +{{code}}
64 +#panelheader('MyPanel')
65 +
66 +#includeForm('Main.MyMenu')
67 +
68 +#panelfooter()
69 +{{/code}}
70 +
71 +1. That is all :)
72 +
41 41  === Create Velocity Macro ===
42 42  
43 43  {{warning}}A write access to your XWiki installation directory is required!{{/warning}}