SharePoint uses templates to define and render the pages that
a site displays. The structure of a SharePoint page includes three main
elements:
-
Master pages define the shared framing elements—the chrome—for all pages in your site.
-
Page layouts define the layout for a specific class of pages.
-
Pages are created from a page layout by authors who add content to page fields.
Figure 1. Master page, page layout, and page
Master pages
A master page defines the chrome (the shared framing
elements) of your site. These elements may include the header and
footer, top navigation, breadcrumbs, search box, site logo, and other
branding elements. The master page remains consistent as visitors
navigate through your site.
A master page also defines regions called content
placeholders that are filled in by content from matching regions on page
layouts. Most commonly, the body of a master page contains just a
single content placeholder (named PlaceHolderMain, which is created automatically), and all of the content from a page layout appears inside this one content placeholder (the PlaceHolderMain content placeholder is outlined in red in Figure 3).
When you preview a master page in Design Manager, you see the following message. This
resides inside the main content placeholder. Put simply, the master
page defines the chrome of a page, and the page layout defines the body
contained in the main content placeholder.
Figure 2. Master page
Figure 3. Master page with page layout outlined
Figure 4. Master page preview message
Page layouts
A page layout is a template for a specific type of page in
your site, such as an article page or a product details page. Just like
its name implies, you can think of a page layout as defining the layout
or structure for the body of a page.
Page layouts define regions or content areas that map to
content placeholders on the master page (outlined in red in Figure 6).
Again, the most common scenario is that a page layout defines a single
content region that maps to the single content placeholder that is
created automatically on a master page.
Figure 5. Page layout
Figure 6. Content region and content placeholder
Page field controls
The primary purpose of a page layout is to arrange page
fields. When you design a page layout, you insert, position, and style
elements called page field controls. These controls will eventually
contain content when an author creates a page based on that page layout.
In addition to page fields, page layouts can also contain Web Part
zones, to which content authors can add Web Parts. (Master pages can't
contain Web Part zones.)
With a page field control, you can define the styles used by the content. Authors can add content to a page, but the designer has ultimate control over how that content is rendered through CSS applied to those controls.
Every page layout is associated with a content type in the
Pages library of a site. A content type is a schema of columns and data
types. For any page layout, the page fields that are available for that
layout correspond directly to the columns defined for that page layout's
content type.
With a page field control, you can define the styles used by the content. Authors can add content to a page, but the designer has ultimate control over how that content is rendered through CSS applied to those controls.
Figure 7. Page layout with page field controls
Relationship of master pages and page layouts
Together, a master page and a page layout create a content page.
The master page defines the chrome for all pages in the
site so, often many page layouts (and therefore many pages created from
those page layouts) are associated with one master page.
But, your site will likely use multiple master pages. For
example, in addition to the default master page, you may have one or
more master pages that target specific devices such as smart phones or
tablets. In this case, one page layout is used by many master pages (see
the section about device channels).
You can use one master page per channel per SharePoint site.
Figure 8. Master page with page layout
Figure 9. One master page tied to three page layouts
You can use one master page per channel per SharePoint site.
Pages
Authors can create pages and add content to the page
fields, and they can add Web Parts to any Web Part zones or Rich Text
Editors. Pages are structured so that content authors cannot make
changes outside of page fields.
The rendered page is what site visitors see. When a page is
requested by the browser, the master page is merged with a page layout
to create a content page, and the content for that page is merged into
the page fields from that page in the Pages library.
Figure 10. Page with authored content
Figure 11. Rendered page in browser
Figure 12. Master page, page layout, and page
No comments:
Post a Comment