Confluence 5.0 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
デコレーターについて
Confluence is built on top of the Open Source SiteMesh library, a web-page layout system that provides a consistent look and feel across a site. SiteMesh works through "decorators" that define a page's layout and structure, and into which the specific content of the page is placed. If you are interested, you can read more on the SiteMesh website.
What this means for Confluence is that you can customise the look and feel of parts of your Confluence site through editing decorators, for example:
- 「メイン」デコレーターは、全体的なヘッダーとフッターを定義します。
- 「ページ」デコレーターはページを表示する方法を定義します。
- 「印刷可能」デコレーターは印刷可能なページのバージョンのルック アンド フィールを定義します。
Confluence 内からこれらのデコレーターを参照および編集することができます。デコレーターに対する変更は、その Confluence 内のすべてのスペースに影響します。
Confluence の管理ページを描画するのに使用されるデコレーターは Confluence 内から編集することはできません。これは、サイトの残りの部分を利用できなくしてしまうミスを犯してしまった場合、管理ページはテンプレートを修正するために利用可能なままである必要があることを意味しています。
デフォルト デコレーターを参照する
At any time, you can browse the default decorators that come packaged with Confluence by following the "View Default" links on the "Site Layouts" page. The template browser also allows you to view the "#parsed" templates that are included within the template when it is compiled. While you can't edit these included templates, you will probably have to copy some or all of them into your custom template as you do your customisation.
カスタム デコレーターを編集する
To edit Confluence decorators you will need a good knowledge of HTML, and some understanding of the Velocity templating language.
デコレーターを編集する方法:
- Confluence 管理 > レイアウトに移動します。
- 編集するデコレーターの隣のカスタムの作成を選択します。
- 変更を保存します。
間違えた場合、または変更を元に戻す場合、編集したデコレーターの隣のデフォルトにリセットを選択します。
別の方法として、カスタムテンプレートはデータベースの DECORATOR に保存されます。テンプレートの編集を介して何らかの方法で Confluence が完全に利用できなくなった場合、DECORATOR テーブルから関連するエンティティを削除します。
マクロ
Some parts of the page are drawn using Velocity macros, including the navigation bar. The macros you should know about when editing decorators are described in Working With Decorator Macros.
高度なユーザーの場合
velocity ディレクトリは Confluence の Velocity テンプレートの検索パスの手前にあります。そのため、同じ名前のファイルを適切な場所に配置することで、Confluence の任意の Velocity テンプレートを上書きできます。
これは推奨されませんが、Confluence のあらゆる側面の外観を完全に制御できます。また、お望みなら、ブラウザではなく、テキスト エディタでテンプレートを編集することができます。
ただし、重要な注意点が2つあります。
- Velocity はテンプレートをメモリにキャッシュするように設定されています。Confluence 内からページを編集する場合、そのページをディスクからリロードします。ディスク上のページを編集する場合、
WEB-INF/classes/velocity.propertiesで Velocity のキャッシングを一時的にオフにするか、変更を可視化するためにサーバを再起動する必要があります。 - 変更は、Confluence の今後のバーションで予測できない相互作用を与える場合があります。アップグレードする場合、稼働中のサイトに展開する前に、常にカスタム変更をテストする必要があります。
