Skin Application
Create, edit and manage Skins |
Type | XAR |
Category | |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Bundled With | XWiki Standard |
Table of contents
Description
Offers the ability to edit an existing skin.
How to use it
- Go to the Administration, in the "Presentation" section:
- Enter the name of the skin to edit (by default: XWiki.DefaultSkin).
- Click on "Customize".
- You will get the skin edition page:
- Here you can set the name of the skin, the parent of the skin (base skin) and you can change the logo. ( ).
- You can also select the output syntax your skin is using: HTML 5 for recent skins, and XHTML 1.0 for old ones. This setting is used by XWiki to know which renderer to use along with the skin, which is important to generate valid HTML code.
Templates customization
Principle
A skin is made of templates written in Velocity (*.vm files), JavaScript (*.js files), CSS and LESS. Each XWiki action is bound to a template, organized like this:
Action | Template |
---|---|
View | view.vm |
Edit | edit.vm |
Main CSS file | style.css |
Main LESS file | less/style.less.vm |
Inside a template, you can include an other template, so that you can split your skin in different files. The syntax is:
In XWiki, there is two types of skins:
- the file system skins, which are made of template files directly stored in the webapp folder
- the wiki skins, which are made of templates stored in the wiki.
The main skins (Flamingo, Colibri) are stored in the file system, so they can be used even when the database is empty. It is a logical choice for default skins.
The user skins are usually stored in the wiki (so in the database). They are based on existing skins but they just override some templates. They are also easier to install, since you just need to import a XAR or to install the skin with the Extension Manager.
How to override a template
There is 2 ways to override a template (+ a deprecated one):
- By adding an overridden template object
- By adding an attachment to the skin
Adding an overridden template object
- Go to the "Overridden templates" section:
- Enter the name of the template that you want to override (eg: view.vm, footer.vm, style.css, etc...). If the template is stored inside a directory, you can use the "/" character as separator (eg: less/style.less.vm, less/headers.less).
- Click to the "add" button:
- Here you can write the content of the template. We usually take the content of the existing template from the parent skin (by browsing the http://localhost:8080/xwiki/skins/flamingo/footer.vm URL) and we add some customization in it:
- Save the skin
It's done, you have introduced an overridden template.
Note: for resources for which the URL needs to be fetched and used (using $xwiki.getSkinFile(), this mechanism of overwrite won't work, as the .getSkinFile() won't return properly an URL to the resource. This may apply to some css resources, for example print.css . In order to have an overwrite for these files, you need to overwrite by using an attachment, as described below. There is an open ticket about this, XWIKI-18297.
Adding an attachment
For resources files (images, fonts, etc) or for big templates, you can add the template as an attachment of the skin.
The deprecated way
For retro-compatibility reason, we have introduced a "deprecated properties" section. In there, you can override some templates. See the documentation of this mechanism.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-skin-ui 16.8.0):
- org.xwiki.platform:xwiki-platform-localization-script 16.8.0
- org.xwiki.platform:xwiki-platform-localization-macro 16.8.0
- org.xwiki.rendering:xwiki-rendering-macro-message 16.8.0
- org.xwiki.platform:xwiki-platform-rendering-macro-velocity 16.8.0
- org.xwiki.platform:xwiki-platform-csrf 16.8.0
- org.xwiki.rendering:xwiki-rendering-macro-html 16.8.0
- org.xwiki.platform:xwiki-platform-rendering-xwiki 16.8.0
- org.xwiki.platform:xwiki-platform-icon-script 16.8.0