瞭解一下WSS中的Feature

來源:互聯網
上載者:User

今天有了一點點收穫,就是自訂WSS網站操作按鈕。

方法很簡單,大概就是在WSS中增加一個Feature。大概步驟是:

  1. 在SharePoint的Feature檔案夾下建立一個子檔案夾
  2. 在該檔案夾中建立兩個xml檔案:Feature.xml , Elements.xml
  3. 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的名稱和路徑

     

  4. 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:只有管理員權限的使用者可見

     

  5. 執行命令列安裝、啟用Feature
    1. stsadm –o installfeature
    2. stsadm –o activatefeature

ok!到此就完成了,很簡單吧,雖然有很多不太清楚的地方,不過研究一下會越來越明白的~

 

加油了 呵呵

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.