0

I have a SharePoint Solution written in C#. This solution has an event receiver. When feature is activated this event receiver adds a link to Left Navigation menu.

When the feature is activated on a personal site (MySite) it looks like this How owner sees a link

But other users do not see this link

How others sees a link

public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        SPWeb web = properties.Feature.Parent as SPWeb;

        if (web != null)
        {

            web.AllowUnsafeUpdates = true;

            SPList library = web.GetList(web.ServerRelativeUrl + "/Lists/" + "MyList");
            if (library != null)
            {
                SPListItem folder = library.Items.Add("", SPFileSystemObjectType.Folder, "FolderName");
                folder.Update();
                string title = "LinkForFolder";
                SPNavigationNodeCollection quickLaunch = web.Navigation.QuickLaunch;
                SPNavigationNode prgSum = new SPNavigationNode(title, library.DefaultViewUrl);
                SPNavigationNode previosLibraryNode = web.Navigation.GetNodeByUrl(library.DefaultViewUrl);
                if (previosLibraryNode != null)
                {
                    quickLaunch.Delete(previosLibraryNode);
                }

                SPNavigationNode previosNode = web.Navigation.GetNodeByUrl(web.ServerRelativeUrl + "/person.aspx");
                if (previosNode != null)
                {
                    quickLaunch.Add(prgSum, previosNode);
                }
                else
                {
                    quickLaunch.AddAsLast(prgSum);
                }

            }
        }
        else
        {
            throw new Exception("Event Receiver feature failed to get current context.");
        }
    }

And my question is - How to make a link visible to all?

  • Please share your code that adds the link. – Lars Fastrup Jan 11 '17 at 15:16
0

It appears that the best way to do this would be to update the mysites master page.

Take a look at the following examples.

Changing Left navigation in MySite (my content) for all users Deep Dive into the Confusing SharePoint 2013 MySite Quick Launch Left Nav

  • Thank you! But I thought that this can be done using a c# – Денис Дягилев Jan 12 '17 at 7:40
  • Maybe you can. I just don't see the benefit of doing it that way. You're making it unnecessarily difficult. – jpollar Jan 12 '17 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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