Create a Drop-down menu that is consistent with the SharePoint 2010 Style: Integrating feature Cus

Source: Internet
Author: User

In the previous article, "Creating a drop-down menu consistent with the SharePoint 2010", I showed you how to add an extra menu to the top of the page and keep it in line with the SharePoint 2010 built-in menus. If you only need to create a menu that is fixed for a submenu item, the content contained in this article is sufficient. But if you're designing this menu, we're not sure what menu items we need to add to our menus?

In the SharePoint enterprise application development process, we sometimes want to be able to create an extensible menu. Initially, developers add a menu to a location on a SharePoint Site page, and then allow other developers to add additional submenu items to the menu by using a standard extension.

In fact, SharePoint already has one such mechanism built into it. If you know about the custom action, you should be aware that SharePoint developers can add additional menu items, buttons, and, by defining the custom action in feature, to the SharePoint built-in UI interface. Ribbon manipulate controls, and so on UI elements. Can a developer add a menu item to a custom menu through the unified Custom action mechanism? The answer is yes.

When you create a custom menu, you can add featuremenutemplate in addition to adding menuitemtemplate (representing menu items) and submenutemplate (for level two menus). Featuremenutemplate is similar to defining a menu placeholder and defining the location and group IDs for this menu placeholder. After that, developers can add menu items to this menu placeholder by using the custom Action, with a customized location and group ID.

In the following code, a featuremenutemplate is added, and its location is "HP." Extendedmenu ", the Group ID is" Toptoolsmenu ".

Later, other developers can use the custom action element in the standard SharePoint feature framework to add the desired menu item to this location. As shown in the screenshot below, we have defined two custom Action, the first is "about this Site" and the second is "GetIT Support".

Deploy the feature containing the two custom action elements above to the SharePoint system, and when activated on the Web site, you can see that they appear in the menu that we want them to appear in.

By using the feature custom action mechanism, we can make our custom menus more flexible and scalable. For example, when you design a custom master page, you can add a custom menu control to the master page, and developers can add the menu item to the menu repeatedly through the custom action mechanism for the project.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/

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.