Add a feature for the site settings menu in WSS 3.0)

Source: Internet
Author: User
In WSS 3.0 Add Feature

Application:Microsoft Windows SharePoint Services 3.0,Microsoft Office Sharepoint Server 2007,Microsoft Visual maxcompute 2005

Ted Pattison,Ted Pattison Group

2007 5

Summary: InMicrosoft Windows SharePoint ServicesYou can createCustomactionNodeFeatureTo add a custom menu entry to the default site settings menu. In this way, you canSharePointAdd a custom command on the user interface. These commands enable the userSharePointWebsites have functions similar to redirecting to different pages. When you create a menu entry set for the site, you can configure it to enable it to redirect users to anyURL. For example, you can transfer a user to another site. You can also switch users to a custom application.ProgramPage, this page not only allows them to see the custom display data, but also can perform custom content operations under the current site.

Code it

First, create a customFeature. You must define thisFeatureOr within the range of a site set or within the site range. IfFeatureIs defined in the range of a site set, (that is,Scope = "site"), The created menu entries will appear in the site settings menu of each site in the current site set. IfFeatureIs defined in the site range (that is,Scope = "Web"), The constructed menu entries will set the menu for the site under the site on which it is activated. The followingFeatureIs defined within the scope of the site set and containsElements. xmlOfCamlFile reference.

XML

<Feature

AA929AFF-4602-4d7f-A501-B80AC9A4BB52"

Title = "a sample feature: item auditing"

Description = "a sample feature with an ECB menu item"

Scope = "Site"

Xmlns = "http://schemas.microsoft.com/sharepoint/">

<Elementmanifests>

<Elementmanifest location = "elements. xml"/>

</Elementmanifests>

</Feature>

Define a custom setting for the menu entries of the site

UseCustomactionNodes in the defaultSharePointDifferent menu entries and links are defined on the user interface. The followingCustonactionThe node name isElements. xmlOfCamlFile to add a custom menu entry to the site settings menu to convey the user to a custom application page.

XML

<Elements xmlns = "http://schemas.microsoft.com/sharepoint/">

<Customaction

Id = "applicationpage1"

Groupid = "siteactions"

Location = "Microsoft. Sharepoint. standardmenu"

Sequence = "2000"

Title = "Hello world application page"

Description = "getting up and going with Inline code">

<Urlaction url = "~ Site/_ layouts/litware/applicationpage1.aspx "/>

</Customaction>

</Elements>

Conclusion: When you createCustomactionYou must addURLBuilt-in PropertiesUrlactionNode. When you transfer a user to an application page, for exampleApplicationpage1.aspx, You must consider whether you want the application page to run under the current site or under the current site set. In the following example, dynamic flag~ SiteAddedURL. WhenWindows SharePoint ServicesParse thisCustomactionWhen you create a menu entry~ SiteReplace with the actual current siteURL.

~ Site/_ layouts/litware/applicationpage1.asp

When you create a node for a custom menu entry in the site settings menu, you can configure it to make it visible only to users with administrator permissions. Note that the following example addsRequiresiteadministrator.

XML

<Elements xmlns = "http://schemas.microsoft.com/sharepoint/">

<Customaction

Id = "applicationpage1"

Groupid = "siteactions"

Location = "Microsoft. Sharepoint. standardmenu"

Sequence = "2000"

Title = "Hello world application page"

Description = "getting up and going with Inline code"

Requiresiteadministrator = "true">

<Urlaction url = "~ Site/_ layouts/litware/applicationpage1.aspx "/>

</Customaction>

</Elements>

When you addRequiresiteadministratorField,Windows SharePoint ServicesMenu entries are not displayed to users without administrator permissions. Those marked as site set LayersFeatureOneCustomactionNode. Menu entries are only visible to the site set owner or administrator. TheFeatureOneCustomactionNodes, menu entries are only visible to users with administrator permissions under the current site.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.