Forum Discussion

Ivan54's avatar
Ivan54
Bronze Contributor
Mar 06, 2017

How to hide recycle bin in modern UI?

Hi, does anyone know how to hide the Recycle Bin Quick Launch item?

I can turn of quick launch navigation successfully, but Recycle Bin remains, which isn't useful in a publishing scenario (I know proper publishing sites aren't there yet).

  • Hi Ivan54,

     

    Do you have any more details on the requirements? Do you want users to not be able to undelete files if they happen to accidentally delete a file?

     

    • Ivan54's avatar
      Ivan54
      Bronze Contributor

      Hi Pieter Veenstra,

       

      The use case is a basic intranet solution based on modern teamsites.

      Every departments gets a subsite where they can edit and all other employees have read access.

      There is absolute no need for all employees to see the link to the recycle bin. Unchecking the "show quick launch" was exactly that, but now the only link that remains is the trash, which is even more absurd, then showing the full quick launch (incl. recycle bin) :)

       

      To be clear, of course I do not want to "delete" the recycle bin, just hide the UI element. I can instruct the "editors" to navigate to websites contents and from there to the recycle bin for this scenario.

       

      • Hi Ivan54,

         

        I would iniitally thik that this is a permission issue. The best way this should be solved is by giving your read only users no access to the recycle bin. I wonder if you could simply resolve this by giving those read only user even less permission by creating a custom permission level.

         

        I've not tested it recently but I could imagine that if you don't have permissions to delete a file that there wouldn't be any need for a recycle bin either. I remember in the past still seeing the recycle bin.

         

        Using CSS/javascript to remove just the link would be easy, however paulpascha is right that this isn't somehting that is easily done within the modern SharePoint sites.

  • paulpascha's avatar
    paulpascha
    Bronze Contributor

    Traditionallly the only way to hide the link is by inserting custom CSS somehow or removing the server control responsible for rendering the link from the master page. Both options have downsides and I consider them more like hacks. In modern team sites there's no support for custom master pages and there's no way to easily include custom CSS.

     

    One way I can think of is you could create a custom SPFx-based Web Part emitting the required CSS and insert it on pages where you want to hide the link. Its very hard to target all pages this way so there will be cases the link will still be shown.

     

    In the future there will be more SPFx-based options to customize the UI so that might result in more elegant ways being available.

Resources