XMLMenuFeatureReceiver is simple Feature receiver component that adds menu items/tasks to SharePoint Site Actions menu. The menu is defined in an xml document, which the component reads and builds it on the fly.

The Xml file structure is no big rocket science. Any developer would understand it.
The <config> and the <metadata> tags are there for grouping.

The <mainmenu> tag is mandatory; this defines the top level menu.
The main has 4 attributes
name - Display Name
description - <should I explain this? :)>
submenu -- xml element the submenu items are listed under.
or
url – If no sub menus, you can directly assign the URL for this to be stand alone item

E.g.
<config>
<metadata>
<mainmenu>
<menuitem name="Sharepoint Administration" description="Share Point Admin Functions" submenu="adminmenu" />
<menuitem name="Other Goodies" description="Other Goodies" submenu="goodies" />
</mainmenu>

<adminmenu>
<menuitem name="Site features " description="Site features" url="/_layouts/ManageFeatures.aspx"/>
<menuitem name="Site libraries and Lists" description="Manage site libraries and lists" url="/_layouts/mcontent.aspx"/>
<menuitem name="People and Groups" description="Manage People and Groups" url="/_layouts/people.aspx"/>
<menuitem name="Advance Permissions" description="Manage Advance permission " url="/_layouts/user.aspx"/>
</adminmenu>

<goodies>
<menuitem name="Searches" description="Search Links" submenu="search" />
<menuitem name="Code Plex" description="Code Plex" submenu="codeplex" />
</goodies>

<search>
<menuitem name="Microsoft Live" description="Microsoft Live " url="http://www.live.com/"/>
<menuitem name="Google" description="Google Search" url="http://www.google.com"/>
<menuitem name="Yahoo" description="Yahoo" url="http://www.yahoo.com"/>
</search>

<codeplex>
<menuitem name="Code Plex Home" description="CodePlex!" url="http://www.codeplex.com/"/>
<menuitem name="WspBuilder" description="Developer Saviour" url="http://www.codeplex.com/wspbuilder"/>
<menuitem name="xmlFeatureReceiver" description="Shamless promotion!" url="http://www.codeplex.com/xmlFeatureReceiver"/>

</codeplex>

</metadata>
</config>



Please note: WSPBuilder is required for this solution.

Last edited Jun 13, 2008 at 6:42 PM by srikanthd, version 4