Category Archives: Uncategorized

Custom Action URL Won’t Display for New Feature

I’m still in the habit of crafting my feature XML files by hand since it’s all quite new to me.  I don’t want to rely on a front-end tool that does stuff I don’t understand (he said as he wrote a blog entry using a tool he does not understand).

Today, I was trying to add a custom action to the site settings but it just wouldn’t show up.  I could install the feature and see it in the site features, but when I activated it (without error) it simply wouldn’t show up on the drop-down menu.

I finally realized that I misspelled "SharePoint" in the Location attribute of the <CustomAction> node.  This is the bad elements.xml file:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
 Id="SiteActionsToolbar"
 GroupId="SiteActions"
 Location="Microsoft.Sharepoint.StandardMenu"
 Sequence="100"
 Title="Hello!"
 Description="Custom menu action added via a feature."
 ImageUrl="_layouts/images/menuprofile.gif">

    <UrlAction Url="http://www.xyzzy.com"/>

  </CustomAction>
</Elements>

 

Good:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
 Id="SiteActionsToolBar"
 GroupId="SiteActions"
 Location="Microsoft.SharePoint.StandardMenu"
 Sequence="100"
 Title="Hello!"
 Description="Custom menu action added via a feature."
    >
    <UrlAction Url="http://www.xyzzy.com"/>
  </CustomAction>
</Elements>

That one took me a good two hours to figure out 🙂

I take solace in the fact that some day in the future, I’ll be able to say with conviction, "back in the day, I had to walk three miles up hill in the snow (barefoot!) in order to deploy a custom feature to MOSS.  You kids, you don’t know how easy you have it!  Get off my lawn!"

Can’t wait.

</end>

Technorati Tags: ,