Question

Background

One of our clients has made the shift from SharePoint 2010 and SharePoint 2013. They pointed out that there is no longer a link to the Recycle Bin in the Quick Launch (Site Contents is still there, but the Recycle Bin is not).

Adding a link to the Quick Launch

I also noted another person with the same issue where they were advised to add it to the Quick Launch. Adding it to the Quick Launch through normal navigation settings will take a long time for my client because they have many sites (and a few different site collections).

Reference: https://community.office365.com/en-us/f/154/t/162135

Adding a link to the Master Page as seen in v4.master

I have tried a solution whereby you can add SharePoint:SPLinkButton as seen in the v4.master, but this does not work for me and causes the root home page to display a never ending error string (fix one error, shows another, makes me run around in circles).

Reference: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/abef3c0c-a84f-42d6-b3a7-bd2c5c9287ae/add-recycle-bin-link-to-quick-launch?forum=sharepointdevelopment


Question: Is there a way to add a link back in via the master page that also considers the permissions?

I'd only like users who have permission to delete items to be able to see the recycle bin.

Was it helpful?

Solution

That is possible but you will have to use a trim control and custom script in the master page to append the recycle bin to the menu. Something like this will do the trick

<SharePoint:SPSecurityTrimmedControl PermissionsString="ManageWeb" runat="server"> 
    <script type="text/javascript">
        document.getElementsByClassName('root ms-core-listMenu-root static')[1].innerHTML += '<li class="static"><a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" href="/_layouts/15/RecycleBin.aspx"><span class="additional-background ms-navedit-flyoutArrow"><span class="menu-item-text">Recycle Bin</span></span></a></li>';
    </script>
</SharePoint:SPSecurityTrimmedControl>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top