Modify the display style in the left navigation bar (reproduced from sunmoonfire's artistic matrix)

Source: Internet
Author: User
This is an excellent solution.ArticleYou can change the style of the left-side navigation bar by modifying the CSS.Code. I am afraid that the connection will fail, so I will pass the article directly. I hope the author will forgive me. If there is anything wrong, please let me know and I will delete the article! Wss3sdk: How to customize the display style for Quick Start (reproduced from sunmoonfire's artistic matrix) You can customize Quick Start by modifying the navigation control attributes. The control is located in the default. Master dashboard page file and is deployed in the (local_drive: \ programe files \ microsoft shared \ Web Server Extensions \ 12 \ template \ global) folder by default. This file is the dashboard page of WSS and contains the page layout of the site, including the template of the navigation area in the SharePoint page.
The dashboard page contains two control templates, which are available on the existing homepage by default. One is Microsoft. Sharepoint. webcontrols. Menu Control, used to display the standard Quick Start view in the left navigation area; the other is Microsoft. Sharepoint. webcontrols. sptreeview Control, used to display the site folder view. We can select which view to display on the user interface.

Select the view control to be displayed in the left-side navigation pane of the Site Page. 1. Select Website operations In Website settings , In Appearance In this section, select Tree View .
2. Select Enable Quick Start To display the Quick Start view, or select Enable Tree View To display the folder view.
As an example of customizing the left navigation, we can fold the Quick Start and then set Menu Add the "Fly-out menu after the sensor mouse" to display the properties of the control. This type of customization requires you to use Microsoft Office Sharepoint designer 2007 to modify default. Master, or create a custom. master file, and then use the object model to direct the site to a new master page file.

Use SharePoint designer to modify the default. Mater instance in the site master page library to display the folding view with the fly-out menu. 1. Select Website operations In Website settings , In Library In this section, select Master page .
2. Master page Library Page, select Edit in mirosoft Office Sharepoint designer .
3. In the Code view, find the corresponding Contentplaceholder Container Control, whose ID is Placeholderleftnavbar . In Placeholderleftnavbar , Find Aspmenu Control, whose ID is Quicklaunchmenu .
4. Set Menu The staticdisplaylevels and maximumdynamicdisplaylevels values of the control are set to 1. As follows: < ASP: aspmenu
ID = "Quicklaunchmenu"
Performanceid = "Quicklaunchsitemap"
Runat = "Server"
Orientation = "Vertical"
Staticdisplaylevels = "1"
Itemwrap = "True"
Maximumdynamicdisplaylevels = "1"
Staticsubmenuindent = "0"
Skiplinktext = ""
>

5. Save the file and open the website page to view the effect.

Attached here:

Create a custom master page file and use the SharePoint object model to display the folding view with the fly-out menu. 1. Copy the default file. master (in the \ 12 \ template \ global folder) and rename it to mydefault. master.
2. Open the new mydefault. Master File and find the corresponding Contentplaceholder Container Control, whose ID is Placeholderleftnavbar .
3. Placeholderleftnavbar , Find Aspmenu Control, whose ID is Quicklaunchmenu . Set staticdisplaylevels and maximumdynamicdisplaylevels to 1. As follows: < ASP: aspmenu
ID = "Quicklaunchmenu"
Performanceid = "Quicklaunchsitemap"
Runat = "Server"
Orientation = "Vertical"
Staticdisplaylevels = "1"
Itemwrap = "True"
Maximumdynamicdisplaylevels = "1"
Staticsubmenuindent = "0"
Skiplinktext = ""
> 4. Create a website. In Visual Studio, use the Microsoft. Sharepoint. spweb. masterurl attribute to direct the site master page to a custom. master file, as shown below:
C # Spweb subsite = Spcontrol. getcontextweb (context );
Subsite. masterurl =   " /Site/subsite/_ catalogs/masterpage/mydefault. Master " ;

Because the Code contains operations to change the content database, there must beMicrosoft. Sharepoint. webcontrols. formdigestControl (which can be run in a webpart. This control is included in the Web Part Page. You can also add this control to the form label on the general ASPX page to run the code on the page ). Also, do not forget to referenceMicrosoft. SharePointAndMicrosoft. Sharepoint. webcontrolsNamespace.
5. Restart IIS to make the change take effect. Then open the website page to view the effect.

Replace Menu Control with Treeview 1. Open the mydefault. master file we created earlier and find the corresponding Contentplaceholder Container Control, whose ID is Placeholderleftnavbar .
2. Placeholderleftnavbar , Find Aspmenu Control, whose ID is Quicklaunchmenu . Then SharePoint: aspmenu Both the start and end labels of are replaced SharePoint: sptreeview .
3. Remove new Sptreeview Elements include the following Levelmenuitemstyles Element. < Levelmenuitemstyles >
< ASP: menuitemstyle Cssclass = "MS-navheader" />
< ASP: menuitemstyle Cssclass = "MS-navitem" />
</ Levelmenuitemstyles >
< Levelsubmenustyles >
< ASP: submenustyle Cssclass = "Ms-navSubMenu1" />
< ASP: submenustyle Cssclass = "Ms-navSubMenu2" />
</ Levelsubmenustyles > 4. Restart IIS to make the change take effect.
The sptreeview control provides many attributes that can be easily customized.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.