`
yake022
  • 浏览: 9404 次
社区版块
存档分类
最新评论

Replacing SharePoint 2010 Menu Control

阅读更多

原文链接

 

March 4, 2011 by Aryan Nava

 

Do you want to change the SharePoint 2010 Menu Control to this?



 

Try the following steps to change SharePoint 2010 Menu Control

 

 

 

To replace the Menu control with a TreeView control
  1. In SharePoint Designer 2010, open the website that you want to customize.

  2. In the Navigation pane, select Master Pages.

  3. Right-click v4.master, and then click Copy.

  4. Right-click an empty area of the Master Pages pane, and then click Paste.

    The file v4_copy(1).master is created.

  5. Right-click v4_copy(1).master, click Rename, and type a new name, such as v4_sample.master.

Edit the master page and go to code view



 7. CTRL + F and find the code
<SharePoint:AspMenu id="V4QuickLaunchMenu"



 8. Right click V4QuickLaunchMenu, select Select Tag, and then press the Delete key.



 9. Replace the deleted markup with markup for three new controls, an SPHierarchyDataSourceControl and an SPRememberScroll control that contains an SPTreeView control.

<SharePoint:SPHierarchyDataSourceControl
      id="MyTreeViewDataSource"
      runat="server" RootContextObject="Web"
      IncludeDiscussionFolders="true" />
<SharePoint:SPRememberScroll
      id="MyTreeViewRememberScroll"
      runat="server" 
      style="overflow: auto;height: 400px;width: 150px; ">
  <SharePoint:SPTreeView
        id="MyWebTreeView"
        runat="server"
        ShowLines="true"
        DataSourceId="MyTreeViewDataSource"
        ExpandDepth="3"
        SelectedNodeStyle-CssClass="ms-tvselected"
        NodeStyle-CssClass="ms-navitem"
        NodeStyle-HorizontalPadding="2"
        NodeStyle-VerticalPadding="5"
        SkipLinkText=""
        NodeIndent="20"
        ExpandImageUrl="/_layouts/images/tvplus.gif"
        CollapseImageUrl="/_layouts/images/tvminus.gif"
        NoExpandImageUrl="/_layouts/images/tvblank.gif" />
</SharePoint:SPRememberScroll>

 

10. On the File menu, click Save.

      11. In the Navigation pane, select Master Pages. Right-click the name of your master page, and then click Set as Default Master Page.


     Open a page in the website to see the result of your changes. You will see your menu is changed to this.


     

 

  • 大小: 74.3 KB
  • 大小: 132.3 KB
  • 大小: 16.3 KB
  • 大小: 18.1 KB
  • 大小: 13.6 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics