Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've got this code adding a menu item to the PersonalActions menu. It works on the main site but not on sub sites, any ideas why?

elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements Id="9876b641-54a4-433e-8a4d-6a5d4eb34f81" xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="ID_ResetPassword"
    GroupId="PersonalActions"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="1000"
    Title="Reset Password"
    Description="Reset your password">
    <UrlAction Url="schemes/Documents/ResetPassword.aspx"/>
  </CustomAction>
</Elements>

edit: as recommended by TimeToThine i've added a feature.xml file:

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="59dc5cf5-de9f-44ab-8c3e-a5923494ae47"
      Title="BlankFeature1"
      Description="Description for BlankFeature1"
      Version="12.0.0.0"
      Hidden="FALSE"
      Scope="Site"
      DefaultResourceFile="core"
      xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml"/>    
  </ElementManifests>
</Feature>
share|improve this question

2 Answers 2

For all the examples I am looking into since yesterday for my custom action I am developing for `GroupId="ActionsMenu" I didn't seen any of element tag has any id like yours

<Elements Id="9876b641-54a4-433e-8a4d-6a5d4eb34f81" 

So not sure if that's the issue, also can you add code for feature your using as need to check what's its scope. e.g. if you want it to activate feature for all sites within a site collection then code should be something like this,

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="GUID-ID"
          Title="abc"
          Description="Description for ab"
          Version="12.0.0.0"
          Hidden="FALSE"
          Scope="Site" // for site collection it has to be site, and web for a single site

Hope it helps ;)

EDIT

In your <UrlAction Url="schemes/Documents/ResetPassword.aspx"/>try to put this page in layout folder in 12 hive (in SharePoint 2007) with right permissions, e.g.

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS

or WSP Builder can do it for you, just make another folder named as "LAYOUTS" in your "TEMPLATE" folder in Visual studio folder structure and add your existing resetpassword.aspx page to it, might help.

in end your URLAction will be like:

<UrlAction Url="/_layouts/ResetPassword.aspx"/> 
share|improve this answer
    
Thanks for reply, how would I add a feature? I'm using VS2008 and all tutorials I can find are using VS2010. –  ng93 Nov 14 '12 at 21:51
    
Use WSB builder extension for visual studio wspbuilder.codeplex.com , it will make your life way easier trust me ;) –  Muhammad Raja Nov 15 '12 at 8:00
    
OK i've added a feature but it's made no difference, also if I take out the ID from the elements tag the menu item isn't displayed. –  ng93 Nov 15 '12 at 9:43
up vote 0 down vote accepted

Right I've figured it out now so posting this incase someone else has the same issue.

In the pkg folder (will need to select show all files in solution explorer to see it) there was a couple of sub folders each with a feature.xml file in them. These were set to Scope=Web, despite the main feature.xml file (in the OP) being set to Scope=Site. I changed these to Scope=Site and it works great now :D.

Not sure if this was the root cause of the problem but hey it works so I'm happy xD.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.