Master Pages vs. Page Layouts in Sharepoint 2010
For those new to Sharepoint, specifically Sharepoint 2010, here is a primer on the difference between page layouts and master pages.
Master Pages
A master page is what I would normally call something like a template. It holds all of Sharepoint's necessary elements. It creates containers for your information to load into later. It sets the document structure. An analogy would be an empty bookcase. It's created a bunch of holding places for different elements. You'll use some of these elements, and Sharepoint will use the rest. So it's VERY important to not remove elements in this page unless you really know what you're doing. You might not need the item, but Sharepoint might need it to run the page correctly.
What Master Pages are used for:
Calling CSS files
Installing javascript & other scripts
Tracking codes (I put my Google Analytics code here)
Setting top navigation & sidebar functionality
Things that occur on EVERY page.
What Master Pages are not used for:
Controlling page-level design and structure
Webparts and Webpartzones (you can…but I wouldn't)
Anything that DOESN"T occur on EVERY page
Page Layouts
In a page layout, you are essentially telling Sharepoint what it should fill all those empty bookshelves with.You declare a control (a certain shelf), and then tell Sharpeoint what goes inside. You can't go beyond the reaches of the master pages. Whatever controls are on the master page are the controls you can use in a page layout.
What Page Layouts are used for:
Creating the layout of the pages (within the bounds of the master page)
Controlling page-level design elements.
Including page-level css files to override master page styles
Inserting Webparts and Webpartzones
Including custom codes (javascript, etc.)
Things that occur only on this page layout, not site-wide
What Page Layouts are not used for:
Content. This is not the place to write and display content. You'll create a page to do that. This is merely to provide the placeholders to do that.
Applying CSS styles that could be applied at a higher level. You want to keep the management of things like CSS as centralized and high as possible.
A few extra tips:
You should never need more than 1 master page (unless for some reason you decide you want a different "admin" and "front-end" master page.
Page layouts should be used sparingly. It can get a bit out of control, so consider what you need and make some generic templates using page layouts that will work for
Diff user control VS MasterPage:
user control
1)it extension is .ascx.
2)it can be more than one on single web page.
3)it doesn't contain Contentplaceholder.
4)it doesn't work like a fixed template.it can be
display in diffrent manner in diffrent page.
MasterPage:
1) it extension is .Master.
2)it used like a template.
3)it contain ContentPlaceHolder.
Diff MASTER PAGE VS PAGE LAYOUT
Master page
Master pages form the basic structure of all pages in a site. A master page is the template into which the
other pages fit.
SharePoint uses a master page to define the basic structure and then a set of pages to provide the
page specific parts. SharePoint Server further uses page layouts to provide the template for the content to be displayed. From these page layouts, page instances are created.
Page Layout
Page Layout is part of SharePoint publishing features, which are the Web content management
features of SharePoint.
These templates allow content authors to focus on generating their content. SharePoint manages the merging of the user content and the template into a single, consistent page. Page layouts are templates into which
content will be added but these templates still fall inside of the scope of what the master page defines, but they further refine what is on the page by including specific Web Part zones, Web Parts, and field controls.
Page layouts are a SharePoint Server 2010 Web Content Management feature so they are not available in
SharePoint Foundation.
When users use the publishing features to create a new page, they are creating a new page instance. The
page layout is selected (the content type is inferred) and the user is presented with an opportunity to
enter the content. Under the covers, SharePoint merges the content and the template into a single output that is returned to users when they browse the site.
For those new to Sharepoint, specifically Sharepoint 2010, here is a primer on the difference between page layouts and master pages.
Master Pages
A master page is what I would normally call something like a template. It holds all of Sharepoint's necessary elements. It creates containers for your information to load into later. It sets the document structure. An analogy would be an empty bookcase. It's created a bunch of holding places for different elements. You'll use some of these elements, and Sharepoint will use the rest. So it's VERY important to not remove elements in this page unless you really know what you're doing. You might not need the item, but Sharepoint might need it to run the page correctly.
What Master Pages are used for:
Calling CSS files
Installing javascript & other scripts
Tracking codes (I put my Google Analytics code here)
Setting top navigation & sidebar functionality
Things that occur on EVERY page.
What Master Pages are not used for:
Controlling page-level design and structure
Webparts and Webpartzones (you can…but I wouldn't)
Anything that DOESN"T occur on EVERY page
Page Layouts
In a page layout, you are essentially telling Sharepoint what it should fill all those empty bookshelves with.You declare a control (a certain shelf), and then tell Sharpeoint what goes inside. You can't go beyond the reaches of the master pages. Whatever controls are on the master page are the controls you can use in a page layout.
What Page Layouts are used for:
Creating the layout of the pages (within the bounds of the master page)
Controlling page-level design elements.
Including page-level css files to override master page styles
Inserting Webparts and Webpartzones
Including custom codes (javascript, etc.)
Things that occur only on this page layout, not site-wide
What Page Layouts are not used for:
Content. This is not the place to write and display content. You'll create a page to do that. This is merely to provide the placeholders to do that.
Applying CSS styles that could be applied at a higher level. You want to keep the management of things like CSS as centralized and high as possible.
A few extra tips:
You should never need more than 1 master page (unless for some reason you decide you want a different "admin" and "front-end" master page.
Page layouts should be used sparingly. It can get a bit out of control, so consider what you need and make some generic templates using page layouts that will work for
Diff user control VS MasterPage:
user control
1)it extension is .ascx.
2)it can be more than one on single web page.
3)it doesn't contain Contentplaceholder.
4)it doesn't work like a fixed template.it can be
display in diffrent manner in diffrent page.
MasterPage:
1) it extension is .Master.
2)it used like a template.
3)it contain ContentPlaceHolder.
Diff MASTER PAGE VS PAGE LAYOUT
Master page
Master pages form the basic structure of all pages in a site. A master page is the template into which the
other pages fit.
SharePoint uses a master page to define the basic structure and then a set of pages to provide the
page specific parts. SharePoint Server further uses page layouts to provide the template for the content to be displayed. From these page layouts, page instances are created.
Page Layout
Page Layout is part of SharePoint publishing features, which are the Web content management
features of SharePoint.
These templates allow content authors to focus on generating their content. SharePoint manages the merging of the user content and the template into a single, consistent page. Page layouts are templates into which
content will be added but these templates still fall inside of the scope of what the master page defines, but they further refine what is on the page by including specific Web Part zones, Web Parts, and field controls.
Page layouts are a SharePoint Server 2010 Web Content Management feature so they are not available in
SharePoint Foundation.
When users use the publishing features to create a new page, they are creating a new page instance. The
page layout is selected (the content type is inferred) and the user is presented with an opportunity to
enter the content. Under the covers, SharePoint merges the content and the template into a single output that is returned to users when they browse the site.
No comments:
Post a Comment