Paul Galvin's (old) SharePoint space [SharePoint

Just another WordPress.com site

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: ,
Advertisements

4 responses to “Custom Action URL Won’t Display for New Feature

  1. Unknown April 15, 2008 at 6:20 am

    Thank you! Thank you! Thank you!
     
    It took me litteraly 3 hours until i found your website and saw that indeed i spelled Sharepoint wrong. Why the hell is it "SharePoint"?!?!
     
    anyways thanks a lot man!

  2. Patrick April 28, 2008 at 1:35 am

    Good on you Paul.I was deploying a feature too and this got me.Cya on the forum :)Patrickhttp://geekswithblogs.net/naijacoder

  3. David June 26, 2008 at 12:36 pm

    Thanks a lot!  This one got me, too!  Found your post after wasting a bunch of time.  Thanks for posting!  Dave.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: