Add TreeView to Site
By Anatoly Mironov
For all of who use Randy Drisgill’s starter masters, it won’t help if you go to Site Actions TreView and just enable it, because the DelegateControl is in a hidden panel. To really restore the original treeview you have to copy this xml from v4.master:
<Sharepoint:UIVersionedContent runat="server" UIVersion="4">
<ContentTemplate>
<Sharepoint:SPNavigationManager
id="TreeViewNavigationManagerV4"
runat="server"
ContainedControl="TreeView"
CssClass="s4-treeView"
>
<SharePoint:SPLinkButton runat="server"
NavigateUrl="~site/\_layouts/viewlsts.aspx"
id="idNavLinkSiteHierarchyV4"
Text="<%$Resources:wss,treeview\_header%>"
accesskey="<%$Resources:wss,quiklnch\_allcontent\_AK%>"
CssClass="s4-qlheader" />
<div class="ms-treeviewouter">
<SharePoint:DelegateControl runat="server" ControlId="TreeViewAndDataSource">
<Template\_Controls>
<SharePoint:SPHierarchyDataSourceControl
runat="server"
id="TreeViewDataSourceV4"
RootContextObject="Web"
IncludeDiscussionFolders="true"
/>
<SharePoint:SPRememberScroll runat="server"
id="TreeViewRememberScrollV4"
onscroll="javascript:_spRecordScrollPositions(this);"
style="overflow: auto;height: 400px;width: 155px; ">
<Sharepoint:SPTreeView
id="WebTreeViewV4"
runat="server"
ShowLines="false"
DataSourceId="TreeViewDataSourceV4"
ExpandDepth="0"
SelectedNodeStyle-CssClass="ms-tvselected"
NodeStyle-CssClass="ms-navitem"
SkipLinkText=""
NodeIndent="12"
ExpandImageUrl="/_layouts/images/tvclosed.png"
ExpandImageUrlRtl="/_layouts/images/tvclosedrtl.png"
CollapseImageUrl="/_layouts/images/tvopen.png"
CollapseImageUrlRtl="/_layouts/images/tvopenrtl.png"
NoExpandImageUrl="/_layouts/images/tvblank.gif"
>
</Sharepoint:SPTreeView>
</Sharepoint:SPRememberScroll>
</Template_Controls>
</SharePoint:DelegateControl>
</div>
</Sharepoint:SPNavigationManager>
</ContentTemplate>
</SharePoint:UIVersionedContent>
and paste it before:
<asp:ContentPlaceHolder id="PlaceHolderQuickLaunchBottom" runat="server">
And of course we must remove the delegatecontrol duplicate from the hidden panel: `` <SharePoint:DelegateControl runat=“server” ControlId=“TreeViewAndDataSource”></SharePoint:DelegateControl>
## Comments from Wordpress.com
####
[Anatoly Mironov]( "mirontoli@gmail.com") - <time datetime="2012-11-26 11:01:40">Nov 1, 2012</time>
Hi Zong! Thanks for your reply and the question. It is very seldom I need to show the treeview and I haven't used it with security trimming. I would recomment to ask your question on sharepoint.stackexchange.com. Maybe someone else has done it before.
<hr />
####
[Zong Low]( "1005684D@student.tp.edu.sg") - <time datetime="2012-11-26 05:32:41">Nov 1, 2012</time>
Hi Mr Anatoly, A grateful thanks to your post. As a SharePoint beginner i have some question for you. Is it possible to add security trimming on the TreeView just allow the authorized user can see whatever are allowed them to see on the TreeView? My portal is shared with 3 different users and they can view my library title or document from the TreeView (just view, not access as they have not enough rights to access the library). \*\*TreeView should not be disabled or hidden for the purpose of document and current location navigation. Example: Admin's View for the TreeView: >All Site Content >Library A >Library B User1's view for the TreeView: (No All site Content node & Library B node) >Library A User2's view for the TreeView: (No All site Content node & Library A node) >Library B Regards, Zong
<hr />
####
[Zong Low]( "l_zofz@hotmail.com") - <time datetime="2012-11-27 06:02:58">Nov 2, 2012</time>
HI Anatoly, Thanks for your reply and i will go stack exchange take a look. Hopefully able to find the solution at there. Have a nice day. Thanks and regards, Zong
<hr />
####
[Free backlinks](http://buy-back-link-us.blogspot.com/ "jeniferlandon@yahoo.com") - <time datetime="2015-03-20 06:02:43">Mar 5, 2015</time>
I think that what you typed made a bunch of sense. However, think on this, what if you typed a catchier post title? I mean, I don't want to tell you how to run your blog, but what if you added a headline that grabbed a person's attention? I mean Add TreeView to Site | CHUVASH.eu is kinda boring. You might peek at Yahoo's home page and note how they write article headlines to get people interested. You might add a related video or a related picture or two to grab people interested about what you've written. Just my opinion, it might make your posts a little bit more interesting.
<hr />