簡介
通過web-item插件可以自定義一些UI界面对供,本篇主要講解說明自定義一個(gè)頂部菜單跳轉(zhuǎn)到百度首頁谈截。
Let's start
增加自定義菜單需要使用web-item插件,在atlassian-plugin.xml文件中增加以下配置
<web-item key="baidu-link" name="baidu-link" section="system.header/left" weight="60">
<description>a system header link demo</description>
<label key="system.header.left.baidu" />
<link linkId="system-header-baidu-link" >http://www.baidu.com</link>
</web-item>
我們定義一個(gè)鏈接跳轉(zhuǎn)到百度首頁捷兰,其中重要位置是section屬性配置出革,這里配置說明要在整個(gè)應(yīng)用的頂部菜單上靠左增加一個(gè)鏈接贝或,鏈接的名字根據(jù)label來定義谓着,在plugin-demo.properties文件中增加:system.header.left.baidu=Baidu泼诱,link定義跳轉(zhuǎn)鏈接地址。啟動(dòng)程序后效果如下:
1588323342497.png
其他
本文僅是簡單說明如何增加頂部菜單自定義鏈接赊锚,整個(gè)confluence支持多個(gè)位置菜單定制治筒,包括用戶下拉菜單,系統(tǒng)配置改抡,空間菜單矢炼,編輯器菜單等位置,詳細(xì)配置可以參照此鏈接Web UI modules
示例代碼
https://github.com/chaoyz/plugin-demo