1

I am working on an enterprise wiki site collection, and I have enabled tree view. Which will display the Pages & Documents in the left side navigator, as follow:-

enter image description here But I want to hide the “Documents” and just keep the Pages. I know I can from the SP designer chose to hide the “Documents” library from browser, but I still need the “Documents” folder to be displayed inside the site content, so hiding the Documents library from the SP designer will not work for me.

I tried the following inside a custom css file, but this will only remove the “Documents” text , but not the whole row.

#ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeViewt0
{
display: none !important;

}
ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeViewn1
{
display: none !important;

}
ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeViewt0i
{
display: none !important;

}

Can anyone advice please

2

I tried the following inside a custom css file, but this will only remove the “Documents” text , but not the whole row.

Looking at your CSS, this is because you are only removing the three table cells but not the actual row, which is what you want to remove. You should be able to accomplish this using the jquery .parent() selector (since the TR does not have an ID), like this:

<script type="text/javascript">
$("#ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeViewt0").parent().hide();
</script>

Note that may need to add this to your master page, depending on the scope of the change.

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.