By default, the master page Tree View displays all content types. The project only needs to display the tree views of the specified document libraries. The operations are as follows:
1. Control the display type to reduce the script workload for the next step.
Reference: http://www.cnblogs.com/hanaimin/archive/2008/04/11/1148929.html
You can set ShowWebChildren, ShowListChildren, ShowFolderChildren, and ShowDocLibChildren to display only the document library type:
<SharePoint:SPHierarchyDataSourceControl runat="server" id="TreeViewDataSourceV4" RootContextObject="Web" IncludeDiscussionFolders="false" ShowWebChildren="False" ShowListChildren="False" ShowFolderChildren="true" ShowDocLibChildren="True" />
2. Use Jquery to set the name of the document library to be displayed
Reference: http://www.cnblogs.com/zxtingfeng/archive/2012/08/27/2658211.html
<Script type = "text/javascript"> function hiddenTreeView () {try {// var tree = $ ("# ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeViewV4"); // var tables = tree. children ("table"); // var trs = tree. getElementsByTagName ("TR"); var tds =$ ("# tags> table> tbody> tr> td [class * = 'ctl00 _ PlaceHolderLeftNavBar_ctl01_WebTreeViewV4_2 ']") for (var I = 0; I <tds. length; I ++) {if (tds [I]. outerText = "document" | tds [I]. outerText = "ISO release document library" | tds [I]. outerText = "style repository") {continue;} else {$ (tds [I]). parents ('table '). hide (); $ (tds [I]). parents ('table '). next ('div '). hide () ;}}} catch (e) {}} hiddenTreeView (); </script>