Master Pages, the Branding Handle of SharePoint 2010, are ASP.NET 2.0 Features.Let me give a brief introduction of Master Page basics to the beginners...
All of us have been browsing multiple commercial sites regularly, you must have noticed that most of the content on all the pages have some content in common, like the Site Logo, Company Banner or any Quick links. Though each page has been designed for a different and a specific purpose, the common elements in the pages are placed in a common location called a Master Page. For Instance, in an Online Shopping Site, the product Details Page and the Order Summary Page have their own unique purpose they still have the Company Banner, a logo, and some navigation links in common. These common components are placed in the Master Page.
Basically a master page is an ASP.NET file with the extension .master (for example, MySite.master) with a predefined layout that can include static text, HTML elements, and server controls. The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.
Master pages allow you to create a consistent layout for the pages in your site. A single master page defines the look and feel and standard behaviour that you want for all of the pages (or a group of pages) in your site.
Master Pages have place-holder controls, called ContentPlaceHolders to denote where the dynamic content goes, as well as HTML and JavaScript shared across child pages.
You can then create individual content pages, i.e. the Child Pages that contain the content you want to display. Child pages use those ContentPlaceHolder controls, which must be mapped to the place-holder of the master page that the content page is populating. The rest of the page is defined by the shared parts of the master page, much like a mail merge in a word processor. All markup and server controls in the content page must be placed within the ContentPlaceHolder control.
When users request the child pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.
1. You can open the site in the SPD using either of the following methods: Site Settings- Edit in Sharepoint Designer or Locate SPD from the Start Menu - Programs - Sharepoint
2. Open the Sharepoint sites with the Administrator credentials.
3. On the Site Explorer, click on the Master Pages folder, Take copy of the master page rather than creating it. Copy the v4.master file and paste in the same folder. You can simply leave the default name or rename this.
4. Open the new master page to edit. You will notice the three usual views for the page Design, Split and Code.
5. In the design mode of the page I will make some simple modifications. I will right justify the Quick launch menu using the formating tools on the Home tab. Let me also insert a clip art on to the page using the Clip Art option in Insert tab.
6. Simple Save the page now.
7. Now an important but simple step, set our new Master Page as the defualt Master page of the site. Goto the Master Pages folder in the site explorer, locate the new Master Page right click and select Set as Default Master Page.
8. We are done! Goto your site, refresh it and review your changes.
No comments:
Post a Comment