XWiki HowTo’s
XWiki HowTo's
- General information
- Layout and Behaviour
- Velocity Scripting
- Translations
- Disabling comments, attacments, history and information
- Security & Performance
General information
- Features / Applications
- Getting Started
- Administrator Guide
- Advanced User guide
- Developer guide
- Code Zone
Layout and Behaviour
- Ad hoc CSS and JavaScript extensions
- Changing the skin
- Configure the WYSIWYG editor
- Configure edit comment behavior
- Configuring Wiki Syntaxes and default Syntax
Velocity Scripting
- XWiki Velocity API
- Velocity Macros
- Velocity User Guide
- Include the Velocity code of another XWiki page
Privileges
- Admin rights
#if ($xwiki.hasAdminRights())
The current user has admin rights
#end
- Edit rights
#if($hasEdit)
The current user has edit rights
#end
Create Velocity Macro
- Add a new macro to the file "macros.vm"
- see "<xwiki-installation-root>/xwiki/templates"
- add at the end of the file your new macro, for example:
#macro(myMacroName)
Hello World!
#end
- Register the new macro in the file "macros.txt"
- see "<xwiki-installation-root>/xwiki/templates"
- add at the end of the file the line, for example:
myMacroName=velocity:myMacroName:
- After XWiki restart the new velocity macro can be used in a common way: either using the WYSIWYG editor or text mode.
Translations
Translation of Panels
With an if/else-block
- Put the following velocity script into your panel
#panelheader('MyPanel')
#if ($context.language == "de")
My German translation
#elseif ($context.language == "fr")
My French translation
#else
My default translation
#end
#panelfooter()
- That is all
Loading a translated page into the panel
- Creates a new wiki page with translated content, for example 'Main.MyMenu'.
- Include this page in your panel, for example:
#panelheader('MyPanel')
#includeForm('Main.MyMenu')
#panelfooter()
- That is all
Disabling comments, attacments, history and information
Currently (xwiki-2.0) there is no way to disable this parts from viewing. This parts can be only made invisible at the bottom of pages (tabbed pane).
- Change to the Administration page of you xwiki
- Call the class editor (<server>/xwiki/bin/edit/XWiki/XWikiPreferences?editor=class)
- Add the following properties (type Boolean)
- showcomments
- showattachments
- showhistory
- showinformation
- Save changes
- Add the following properties (type Boolean)
- Call the object editor (<server>/xwiki/bin/edit/XWiki/XWikiPreferences?editor=object)
- Expand "Objects of type XWiki.XWikiPreferences / XWikiPreferences"
- Change the values for all new properties to "No"
- Save changes
- The bottom tabbed pane will disappear, but you can still access this informations through the menu "Show".
See also:
- Disabling at the page or space level
- related jira task "XWIKI-3027"
- related FAQ
- Admin Configuration guide
Security & Performance
See also "xwiki.cfg" and "xwiki.properties" under "<xwiki-installation>/WEB-INF".