今天有了一點點收穫,就是自訂WSS網站操作按鈕。
方法很簡單,大概就是在WSS中增加一個Feature。大概步驟是:
- 在SharePoint的Feature檔案夾下建立一個子檔案夾
- 在該檔案夾中建立兩個xml檔案:Feature.xml , Elements.xml
- Feature.xml檔案中的內容是:
<Feature Title="New Simple Form Toolbar Button"
Scope="Web"
Id="{5B7C862A-BF4A-4ff1-AE9B-036452035307}"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
</ElementManifests>
</Feature>
Title:用於描述這個Feature的文字
Scope:定義在網站範圍,結果菜單僅會出現在特定的已經啟用該功能的網站中。如果定義在網站集合範圍(Scope="Site"),則網站集合中每個網站都會應用此Feature
Id : Feature的ID
ElementManifest的Location:定義elements.xml的名稱和路徑
- Elements.xml檔案的內容是:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="viewall"
GroupId="SiteActions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="2000"
Title="查看所有網站內容"
Description="查看所有網站內容"
RequireSiteAdministrator="True" >
<UrlAction Url="~site/_layouts/viewlsts.aspx"/>
</CustomAction>
</Elements>
ID:記錄 Element的ID
GroupId:有待研究(需要研究的東西還很多阿)
Location:這個很重要,大概是定義你的這個元素的位置,比如"網站操作"按鈕下,還是其他位置
Sequence:指定這個元素的先後位置,2000表示位置在第2000個
Title:指定元素的標題
Description:元素的描述
RequireSiteAdministrator:只有管理員權限的使用者可見
- 執行命令列安裝、啟用Feature
- stsadm –o installfeature
- stsadm –o activatefeature
ok!到此就完成了,很簡單吧,雖然有很多不太清楚的地方,不過研究一下會越來越明白的~
加油了 呵呵