You can modify Confluence's look and feel by editing the 'decorator' (layout) files. Modifying these files allows you to change the look and feel of:

  • The Confluence site as a whole, which includes all spaces within the Confluence site.
  • An individual space within the Confluence site.

This page tells you how to customise the layout files for your Confluence site as a whole. These customisations:

  • Modify the default 'decorator' files of each space in your site.
  • Are reflected in every space unless the space's own equivalent layout files have been customised.

You need System Administrator permissions to perform these customisations.

You can also customise the layout files for a given space. For more information, refer to Customising Space Layouts. Space layout customisations override the equivalent site customisations.

 注意:

If you modify the look and feel of Confluence by following these instructions, you will need to update your customisations when upgrading Confluence. The more dramatic the customisations are, the harder it will be to reapply your changes when upgrading. Please take this into account before proceeding with your customisation. For more information on updating your customisations, please refer to Upgrading Customised Site and Space Layouts.

 

Confluence is built on top of the open source SiteMesh library, a web-page layout system. Read more on the SiteMesh website. To edit the layout of Confluence, you will need to modify these decorator files. A decorator file is a .vmd file and is written in a simple programming language called Velocity. You can learn more from the Velocity User Guide.

Once you are familiar with Velocity, you can edit the decorator files to personalise the appearance of Confluence.

Confluence のデコレーターファイルは、次のカテゴリに分類されています。

  • Site layouts: These are used to define the controls that surround each page in the site. For example, the header and the footer.
  • コンテンツ レイアウト:ページやブログ投稿などのコンテンツの体裁を制御します。ページ自体の表示を変更するのではなく、配置されているコメントや添付ファイルなどの表示方法を変更します。
  • エクスポート レイアウト:スペースやページを HTML 形式でエクスポートするときの体裁を制御します。たとえば、Confluence を使用して静的な Web サイトを作成している場合、このレイアウトを変更する必要があります。

サイト デコレーター ファイルを編集します。

  1. Choose the cog icon  at top right of the screen, then choose Confluence Admin.
  2. Select Layouts under Look and Feel in the left-hand navigation panel.
    • Click View Default to view the .vmd file.
    • Click Create Custom to edit the default .vmd file. This will open the .vmd file in edit mode.
  3. Make changes and click Update.

If something goes wrong: Click Reset Default to revert to the original layouts.

Velocity マクロを使用する

When editing Custom Decorator Templates, there are a number of macros available to define complex or variable parts of the page such as menus and breadcrumbs. You may insert these macros anywhere in your templates. More information on Working With Decorator Macros.

Advanced customisations

Velocity テンプレートのオーバーライド

velocity ディレクトリは Confluence の Velocity テンプレートの検索パスの手前にあります。そのため、同じ名前のファイルを適切な場所に配置することで、Confluence の任意の Velocity テンプレートを上書きできます。これは変更内容を完全に理解している場合にのみ推奨されますが、Confluence のあらゆる側面で外観を完全に制御できます。また、web インターフェイスではなく、テキスト エディタでテンプレートを編集することもできます。

キャッシング

Velocity はテンプレートをメモリにキャッシュするように設定されています。Confluence 内からページを編集する場合、そのページをディスクからリロードします。ディスク上のページを編集する場合、WEB-INF/classes/velocity.properties で Velocity のキャッシングを一時的にオフにするか、変更を可視化するためにサーバを再起動する必要があります。

Velocity ファイルの場所

Confluence インストール ディレクトリで Velocity ファイルを探します。主要な Velocity ファイルは、<CONFLUENCE-INSTALLATION>\confluence\decorators ディレクトリにあります。たとえば、main.vmd, space.vmd, form-aui.vmd, global.vmd などがこのディレクトリにあります。

URL からレイアウトを探す

レイアウトが表示されないくらい広範囲に変更されている場合、URL を直接参照することができます。

http://<confluence base url>/admin/resetdecorator.action?decoratorName=decorators/main.vmd

base URL と適切な .vmd ファイルで置き換えます。

  • ラベルなし