Confluence 2.8 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
Each plugin is described in its own atlassian-plugin.xml file, which specifies attributes of the plugin, including a description of each module it contains. Once you have modified the different components to define a new look and feel for your theme, you will need to configure this file so Confluence knows where to look when overriding the default files.
The easiest way to begin is by copying the atlassian-plugin.xml from one of the default themes bundled with confluence and modifying it for your theme.
The structure of an atlassian-plugin.xml file is fairly self-explanatory. In the code segment below you will find a full example of an atlassian-plugin.xml:
<atlassian-plugin key="com.atlassian.confluence.themes.tabless" name="Plain Theme"> <plugin-info> <description>This theme demonstrates a plain look and feel for Confluence. It is useful as a building block for your own themes.</description> <version>1.0</version> <vendor name="Atlassian Software Systems Pty Ltd" url="http://www.atlassian.com/"/> </plugin-info> <theme key="tabless" name="Tabless Theme" class="com.atlassian.confluence.themes.BasicTheme"> <description>plain Confluence theme.</description> <layout key="com.atlassian.confluence.themes.tabless:main"/> <layout key="com.atlassian.confluence.themes.tabless:global"/> <layout key="com.atlassian.confluence.themes.tabless:space"/> <layout key="com.atlassian.confluence.themes.tabless:page"/> <layout key="com.atlassian.confluence.themes.tabless:blogpost"/> <layout key="com.atlassian.confluence.themes.tabless:mail"/> <colour-scheme key="com.atlassian.confluence.themes.tabless:earth-colours"/> </theme> <layout key="main" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/main.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/main.vmd"/> </layout> <layout key="global" name="Global Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/global.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/global.vmd"/> </layout> <layout key="space" name="Space Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/space.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/space.vmd"/> </layout> <layout key="page" name="Page Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/page.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/page.vmd"/> </layout> <layout key="blogpost" name="Blogpost Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/blogpost.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/blogpost.vmd"/> </layout> <layout key="mail" name="Mail Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/mail.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/mail.vmd"/> </layout> <colour-scheme key="earth-colours" name="Brown and Red Earth Colours" class="com.atlassian.confluence.themes.BaseColourScheme"> <colour key="topbar" value="#440000"/> <colour key="spacename" value="#999999"/> <colour key="headingtext" value="#663300"/> <colour key="link" value="#663300"/> <colour key="border" value="#440000"/> <colour key="navbg" value="#663300"/> <colour key="navtext" value="#ffffff"/> <colour key="navselectedbg" value="#440000"/> <colour key="navselectedtext" value="#ffffff"/> </colour-scheme> </atlassian-plugin>
Modifying the {{atlassian-plugin.xml}}file
We will configure this file section by section.
Plugin information
<atlassian-plugin key="com.atlassian.confluence.themes.tabless" name="Plain Theme"> <plugin-info> <description>This theme demonstrates a plain look and feel for Confluence. It is useful as a building block for your own themes.</description> <version>1.0</version> <vendor name="Atlassian Software Systems Pty Ltd" url="http://www.atlassian.com/"/> </plugin-info>
plugin key : Specify a key that uniquely identifies the plugin, eg. com.example.themes.dinosaur
name : Give the plugin a name.
description : Provide a short description of the plugin.
vendor : Replace the text with your information.
Theme information
<theme key="dinosaurs" name="Dinosaur Theme" class="com.atlassian.confluence.themes.BasicTheme"> <description>A nice theme for the kids</description> <colour-scheme key="com.example.themes.dinosaur:earth-colours"/> <layout key="com.example.themes.dinosaur:main"/> <layout key="com.example.themes.dinosaur:mail-template"/> </theme>
theme key : Specify a key that uniquely identifies the theme.
class : The class of a theme must implement com.atlassian.confluence.themes.Theme
. The com.atlassian.confluence.themes.BasicTheme
class provided with Confluence gathers together all the resources listed within the module definition into a theme.
name : Give the theme a name. Make sure that you replace all instances of the theme name with this name.
description : Provide a short description of your theme
colour-scheme key : A theme can contain an optional colour-scheme
element that defines which colour-scheme module this theme will use. If you are using a new colour scheme, enter its key.
layout key : A theme can contain any number of layout
elements that define which layouts should be applied in this theme. Refer to these modules by their module complete key as shown above.
Referencing the decorators
You will need to add a layout entity as shown below for each of the decorators you are using. See working with decorators
<layout key="page" name="Page Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/page.vmd"> <resource type="velocity" name="decorator" location="com/atlassian/confluence/themes/tabless/page.vmd"/> </layout>
class : The class which each decorator, or layout, is mapped to must implement com.atlassian.confluence.themes.VelocityDecorator
.
overrides : The layout entry must provide an overrides
attribute which defines which decorator within Confluence is being overrridden by the theme.
Location : Specify the location of the new decorator file, so Confluence know where to look when overriding the default decorator.
It is possible for a theme to use modules that aren't in the same plugin as the theme. Just keep in mind that your theme will be messed up if the plugin that the theme depends on is removed.
Including the colour scheme
Colour schemes can be pre-configured for your theme dynamically from the Administration Console. See configuring colour schemes
To transport them within a theme however, they need to be expressed in the atlassian-plugin.xml
file as shown above.
<colour-scheme key="earth-colours" name="Brown and Red Earth Colours" class="com.atlassian.confluence.themes.BaseColourScheme"> <colour key="topbar" value="#440000"/> <colour key="spacename" value="#999999"/> <colour key="headingtext" value="#663300"/> <colour key="link" value="#663300"/> <colour key="border" value="#440000"/> <colour key="navbg" value="#663300"/> <colour key="navtext" value="#ffffff"/> <colour key="navselectedbg" value="#440000"/> <colour key="navselectedtext" value="#ffffff"/> </colour-scheme>
colour-scheme key : Specify a key that uniquely identifies the colour scheme.
name : Give a name to the colour scheme.
class : The class of the colour scheme must implement com.atlassian.confluence.themes.ColourScheme
. The com.atlassian.confluence.themes.BaseColourScheme
class provided with Confluence sets the colours based on the module's configuration.
colour key: For each UI element, you will need to add its name and value.
関連トピック
指定したラベルを持つコンテンツはありません。