Sharepoint master page

Sharepoint master page DEFAULT

Master pages in the SharePoint Add-in model

The approach you take to implement custom master pages in SharePoint sites is different in the new SharePoint Add-in model than it was with Full Trust Code / Farm Solutions. In a typical Full Trust Code (FTC) / Farm Solution branding scenario, custom master pages are created to implement a custom brand. The master pages are typically packaged in a feature that uses declarative code and a FTC / Farm Solution to deploy the master pages and register them with the SharePoint site.

In a SharePoint Add-in model branding scenario, custom master pages may be also be used. You can deploy and register your custom master pages on SharePoint sites via the remote-provisioning pattern.

High-level guidelines for custom master pages

As a rule of a thumb, we would like to provide the following high-level guidelines for custom master pages.

  • You can customize SharePoint sites using custom master pages, but keep in mind this will cause you additional long-term costs and challenges with future updates.
    • In most cases, you can achieve all common branding scenarios with themes, composed looks and alternate CSS.

      See the Branding SharePoint Sites (SharePoint Add-in Recipe) to learn all about the different branding options you have for SharePoint sites with the SharePoint Add-in model. The recipe will help you consider the short and long-term impact of customization from an operational and a maintenance perspective. You may discover that a custom master page is not required to implement your specific branding requirements.

    • If you chose to use custom master pages, be prepared to apply changes to the custom master pages when major functional updates are applied to Office

  • Use remote provisioning to deploy and register custom master pages with SharePoint sites.
  • Do not use declarative code or sandbox code to deploy and register master pages with SharePoint sites.

Team sites vs. publishing sites

When is a custom master page needed?

When applying custom branding to SharePoint sites, you will encounter the need to brand both team sites and publishing sites. Generally speaking, intranets built on SharePoint in both on-premises and Office scenarios use a combination of team sites and publishing sites.

Custom branding requirements often times require specific layout changes that themes and JavaScript embedding techniques cannot accomplish.

In such a scenario, team sites usually do not require the amount of custom branding that publishing sites do and the out-of-the-box SharePoint Contemporary View for mobile devices is usually sufficient to support mobile devices for team sites. Since this is the case, it is best to only use custom master pages for publishing sites and to use AlternativeCSS and custom SharePoint themes (*.spcolor files), font schemes (*.spfont files) and background images defined as composed looks to brand team sites.

Custom master pages are typically applied when a site is provisioned. The remote provisioning process fits very well with this approach. Usually the only time you will use the web browser to manually apply SharePoint branding customization is when you are prototyping or modifying a single SharePoint site that is not planned to grow to include other site collections or sub sites.

More details about custom master pages and page layouts for SharePoint sites

In scenarios where a custom master page is the only way to implement your custom branding requirements you can create a custom master page and page layouts. Keep in mind the points made at the beginning of this article with regard to the long-term maintenance costs associated with this approach.

  • Using custom master pages for SharePoint sites provides the ultimate level of customization (unlimited).
  • Using custom master pages for SharePoint sites requires the largest amount of time to implement and maintain in the short and long term.
  • Any changes to out-of-the-box master pages that come with service updates will not be reflected in custom master pages.
  • You can apply custom master pages at a per-site level.
  • When using a custom master page it is recommended to start with one of the out-of-the-box master pages and modify it to meet your needs.
    • Try to minimize the amount of customization you make with custom master pages; this will make it easier to update them when Office service changes to out-of-the-box master pages must be replicated to custom master pages.
  • There are many required content placeholders in SharePoint master pages that must not be removed or they will cause the pages to error. You will know when you have removed a required content placeholder because the minute you deploy it and assign the master page to your site, errors will appear.

When are custom master pages and page layouts for a SharePoint site a good fit?

This option works well when your branding needs are very specific or you are using publishing sites.

Recommended deployment approaches

Related links

PnP samples

Applies to

  • Office Multi Tenant (MT)
  • Office Dedicated (D) partly
  • SharePoint on-premises – partly

Patterns for dedicated and on-premises are identical with SharePoint Add-in model techniques, but there are differences on the possible technologies that can be used.

Sours: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/master-pages-sharepoint-add-in

Stage 6: Upload and apply a new master page to a publishing site in SharePoint Server

APPLIES TO:yes yes yes noSharePoint in Microsoft

Note

Many of the features described in this series are also available for most sites in SharePoint in Microsoft

Quick overview

As described in Stage 5: Connect your publishing site to a catalog in SharePoint Server, we connected the publishing site to our catalog. When we connected, SharePoint Server automatically created some pages for us, on which some search results where shown. These pages all have the standard SharePoint look. So, now it is time to give them a Contoso look.

In this stage, you'll learn:

Note

This article doesn' t cover how to create a master page. It will only cover how to upload and apply an already completed master page file and other design files that are stored locally on your computer. These files are not available for download.

For info about how to create a master page, see:

Start stage 6

About the master page

When visitors browse our Contoso site, they'll see different content on different pages. The displayed content is a combination of a master page and page layouts.

A master page defines the common layout and interface that you see on all webpages, such as logo, title and navigation menu.

Layout and interface for the individual pages, such as the home page, or the page that displays Audio products, are handled by page layouts. We'll provide more information about them later in this series.

Master Page Page Layout

In earlier versions of SharePoint, you had to design master pages in ASP.NET. These master pages also had to include SharePoint specific markup, such as controls and content placeholders.

In SharePoint Server , you can create a master page in HTML format, and SharePoint Server will convert it to an ASP.NET page for you. This means that when you design your master page, you can use your favorite HTML editor, focus on HTML, CSS, and JavaScript. You don't have to worry about ASP.NET or SharePoint specific markup.

When you add an HTML master page to SharePoint Server , an associated ASP.NET master page is automatically created. Because the two files are associated, any changes that you make to the HTML master page file will be carried over automatically to the associated ASP.NET master page file.

For more information, see Overview of the SharePoint page model.

About the Master Page Gallery

In our scenario, we have an HTML master page and some design assets, such as a CSS file and images, that we want to upload and apply to our Contoso site. All these files are stored on your local computer.

SharePoint expects to find design files in the Master Page Gallery. So this is where we should upload the files. To get to the Master Page Gallery, go to Site Settings --> Master pages and page layouts.

Master Page Gallery

You can use the Upload Document button to upload a single file to the Master Page Gallery. But, using this button every time that you want to add a document can be somewhat cumbersome. To make life easy for yourself, you can map your network drive. This will enable you to drag-and-drop files into the Master Page Gallery with Windows Explorer.

How to map your network drive

  1. From Settings menu, select Design Manager.

    Design Manager

  2. On the Design Manager Welcome page, select 3. Upload Design Files.

    Upload design files

  3. On the Upload Design Files page, copy the URL to your design files.

    Link Design Files

    Note

    The next steps will vary, depending on your computer's operating system. This example shows how to map a network drive on a computer that is running Windows 8.x.

  4. Open Windows Explorer. Right-click Network, and then select Map network drive.

    Map Network Drive

  5. In the Folder field, paste the URL that you copied in step 3, and then select Finish.

    Paste URL

  6. An explorer window with your Master Page Gallery content opens.

    Explore Master Page Gallery

How to turn off versioning for the Master Page Gallery

In our scenario, we are not using SharePoint workflows for approval. The files have already been approved. So before we upload a new master page, we want to turn off versioning for the Master Page Gallery.

To turn off versioning for the Master Page Gallery:

  1. On the LIBRARY tab, select Library Settings.

  2. On the Settings page, select Versioning settings.

  3. On the Versioning Settings page, in the Content Approval section, for Require content approval for submitted items, select No.

  4. In the Document Version History section, for Create a version each time you edit a file in this document library, select No versioning.

  5. In the Require Check Out section, for Require documents to be checked out before they can be edited, select No.

    Versioning

Now we're ready to upload a new master page.

How to upload a new master page

Because we have mapped our network drive, uploading a new master page becomes very easy. Simply drag-and-drop the file into your Master Page Gallery.

Drag and Drop

If you have any associated design files, such as CSS files or images, you can drag-and-drop these into the Master Page Gallery also.

In SharePoint, refresh the Master Page Gallery page to see that the new HTML master page is added. But, notice that an associated ASP.NET master page has not yet been created.

MPG Masterpage Added

Because we dragged and dropped the HTML master page into the Master Page Galley, the content type associated with the file is Design File. For SharePoint Server to create an associated ASP.NET master page, we have to change the content type for the newly uploaded HTML master file. This is performed by changing the file properties.

To change the file properties:

  1. On the Master Page Gallery page, select the newly uploaded master page, and then select Edit Properties.

    Edit Properties

  2. In the Content Type section, select HTML Master Page.

  3. In the Compatible UI Version(s) section, select 15.

    Change File Properties

On the Master Page Gallery page, we can see that an associated ASP.NET master page is created.

We are now ready to apply our new master page.

How to apply a new master page

To apply a new master page:

  1. From the Site Settings page, select Master page (under Look and Feel ).

  2. From the Site Master Page section, from the Specify a master page to be used by this site and all sites that inherit from it, select the newly uploaded master page. In our scenario, this is ContosoElectronicsMaster.

    Apply Master Page

By selecting the Audio page, we verify that our new master page is now being used.

The next step is to start to work on the page layouts.

Next article in this series

Stage 7: Upload page layouts and create new pages in a publishing site in SharePoint Server

See also

Other Resources

Overview of the SharePoint page model

How to: Map a network drive to the SharePoint Master Page Gallery

Overview of Design Manager in SharePoint

How to: Convert an HTML file into a master page in SharePoint Server

How to: Apply a master page to a site in SharePoint Server

Sours: https://docs.microsoft.com/en-us/sharepoint/administration/stageupload-and-apply-a-new-master-page-to-a-publishing-site
  1. Staple synonym
  2. Lci awning problems
  3. Lightinthebox smart watches

Master pages, the Master Page Gallery, and page layouts in SharePoint

Find links to information about using Design Manager to work with master pages, page layouts, and display templates in publishing sites in SharePoint.

Important

This extensibility option is only available for classic SharePoint experiences. You cannot use this option with modern experiences in SharePoint Online, like with communication sites. We do not recommend using classic experience or these branding techniques anymore.

Design Manager is a feature in SharePoint that makes it easier to create a fully customized, pixel-perfect design while using the web-design tools that you're already familiar with. Design Manager is a publishing feature that is available in publishing sites in both SharePoint and Office You can also use Design Manager to brand the public-facing website in Office

For more information about using Design Manager to work with master pages, page layouts, and display templates, see the following articles:

See also

Sours: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/master-pages-the-master-page-gallery-and-page-layouts-in-sharepoint
Master Page Development in SharePoint

SharePoint master pages provide the interface and overall layout of the pages on a SharePoint site. The common elements of a page – its header, navigation links, Site Actions menu, and so forth – they are placed in the same areas regardless of the page you’re viewing. This helps users immediately recognize where they are and helps them easily navigate the site. This continuity of look and feel is accomplished using master pages.

Content that changes from one page to another – such as when you go from the home page to a task list – resides in a content page. When you view a SharePoint page in a web browser, the content page and the master page are merged together to render as a single page.

A master page serves as a container for all of the parts of a content page, and it also contains the necessary code to render the SharePoint interface. You change the user interface or the brand of a SharePoint site by customizing the master page. You can customize the out-of-the-box master page or create a new master page from scratch.

This article provides an overview of master pages and how to manage, customize, and deploy them in your organization.

In this article

What is a master page?

Master pages define the common layout and interface for SharePoint pages. The master page displays the persistent elements that you expect to see when you navigate from page to page on a site. These elements can include a company logo, title, navigation menu, search box, and the colors or graphics associated with the business or organization. On a SharePoint site, you might also expect to see a persistent sign-in link, the Site Actions menu, and the Ribbon commands. These elements are all stored in a master page.

The individual pages on a SharePoint site – the home page, a wiki page, a list view – are all handled as content pages on the site. When these pages are viewed in a browser, they are combined with the master page to produce a single, continuous web page. The master page displays the persistent elements and layout, while the content pages display the unique, page-specific content.

Master pages and content pages

In the following illustration, you see the general areas of a page controlled by the master page and those areas controlled by the content page.

SharePoint master pages

On a typical SharePoint Team site (based on one of the site templates included with SharePoint), you see that the top and left regions come from the master page, while the middle and right regions come from the content page, in this case, the home page.

SharePoint master pages

Note:  These illustrations provide highly-simplified examples of the master page - content page relationship. In actuality, there are several regions of a content page, like the title and description regions, that are located in the same areas as the master page content.

While the master and content pages are separate, they are merged together at runtime to display as a single web page in the web browser. Both pages are ASP.NET pages, but master pages have a .master file extension and they contain the necessary ASP code and content regions to render both pages on a SharePoint site.

To actually see the master page or content page separate from one another, you would need to open them in a supported page editor like SharePoint Designer , which includes design-time support for editing content and master pages.

Top of Page

Master page content placeholders

Master pages and content pages work together using a set of replaceable regions, or content placeholder controls. Each content placeholder (which appears as ContentPlaceHolder in the page code) represents content that can be overridden on the master page. Any page on the site can replace whatever is contained within the content placeholder by supplying a matching content control. That content control can even be empty, which would remove the element entirely from the rendered page.

In the v4.master page in SharePoint , there are approximately 33 content placeholders that are used to display content and functionality on a SharePoint site. You can see these controls when you open the master page directly. In SharePoint Designer , you can use the Manage Content Regions feature to locate each content placeholder control on the page. You can view the control in both code view and the WYSIWYG editor. In the below example, you see the PlaceHolderSiteName control that is used to display the name of the site.

SharePoint master pages

Another content placeholder that is particularly important is PlaceHolderMain because this is what gets replaced by each content page when that page is viewed in a web browser.

You can change the layout of content on a SharePoint site by changing the location of the content placeholder controls. You may, for example, choose to add more content to the right side of the page. You could do this by adding it to the right side of the master page.

Important:  When you customize master pages, avoid deleting content placeholders. Doing so might break some pages and even sites associated with the master page. It’s a good practice to simply hide instead of delete these controls.

Top of Page

Benefits of using master pages

If you’ve ever customized a large enterprise site, you know that creating and deploying a professional, functional, and consistent design can be a challenge. You need a way to create a look and feel that reinforces the brand of your organization and at the same time, make it easy to navigate and use by site visitors, including customers, partners, and employees.

Getting the design right is the first part of the challenge. Implementing and maintaining the design across an entire organization can be an even bigger challenge for a number of reasons. You need to maintain the brand for different types of sites and pages. At the same time, you need to allow for a full range of interactivity and functionality on the site. And you need to be able to enforce the brand even on newly-created sites and pages. SharePoint sites in particular can be challenging because of the range of sites, dynamic content, rich application-like functionality, and of course, the ease with which users can add new sites, pages, lists, and even integration with other sites.

To help you manage this, you use a SharePoint master page to store the structure, common elements, and design of the site. After you implement the design here, every content page associated with the master page instantly displays the new look and feel. This includes site pages, wiki pages, and administrative pages.

Note:  There are some pages associated with different master pages, including pages on a Search Center and pages on a publishing-enabled site. For these pages, you might implement the same brand or come up with a variation of your brand.

When all the content pages display the design from the master page, your sites are easier to use and navigate for end users. Your organization can continue to grow and expand its sites and pages without confusing users and sending them to the wrong location.

Note:  If you do need multiple master pages in your organization, you can use them by enabling master page editing for certain users at the web application or site collection level and then allowing multiple sets of master pages in your organization.

Top of Page

Available master pages in SharePoint

SharePoint includes a new set of master pages that support the new look and feel and new functionality in the product. The new primary master page used on SharePoint pages is called v4.master. Additionally, other master pages are used for special purposes, like publishing-enabled sites, pages that host full-screen applications, pages or sites that were recently upgraded from a previous version of SharePoint, and so on.

The master pages available in SharePoint are described here.

Name / default file name

Description

Uses on a SharePoint site

Primary master page

v4.master

Used for content and administration pages. Provides the interface and layout for SharePoint

Team Site home page, list and library pages, and site settings page.

Minimal master page

minimal.master

Contains minimal SharePoint content, used for full-screen functionality or embedded applications.

The home and search results pages on a Search Center, pages that host Word or Excel web applications.

Publishing master page

nightandday.master

Used for pages on a SharePoint Server publishing-enabled site.

The home page, about us, or press release page on a publishing intranet, extranet, or Internet-facing site.

default master page

default.master

Used to support legacy SharePoint sites, which haven’t been visually upgraded to SharePoint

Home page, site pages, and list pages on a SharePoint site before visual upgrade.

Note:  There is one more master page, simplev4.master, which is used for SharePoint-specific screens, like Login.aspx, Error.aspx, and Confirmation.aspx. This master page, however, is located on the server and cannot be customized in SharePoint Designer

Note:  In addition to these master pages, you can download the Starter Master Page from MSDN. This master page contains the minimum required components, scripts, and placeholders to render a page in SharePoint. You might use this master page to create a whole new design from scratch. The page serves a similar purpose as the “minimal.master” page that was available in SharePoint

Top of Page

What’s new with master pages in SharePoint

There have been a number of improvements to master pages in SharePoint For example, there are new master pages that accommodate the new look and new functionality found in SharePoint , there are more SharePoint pages associated with the primary master page by default, and there are new features in SharePoint Designer that make creating and editing master pages much easier. Here are some of the biggest differences in SharePoint master pages.

New master pages in SharePoint – A set of new master pages is introduced in SharePoint as described in the previous section. The v4.master page is the new primary master page in SharePoint It provides the SharePoint look and feel, interface, and functionality, including the ribbon – a new interface with menus, buttons, and commands similar to Microsoft Office applications. Other master pages include the minimal.master page for full-screen applications and functionality; the default.master page for legacy SharePoint sites; and the dayandnight.master page for publishing-enabled sites in SharePoint Server

Primary master page used for site and application pages – The primary master page is now used for both content pages and application pages in SharePoint This means that your customized master page not only appears on your site’s home page, list and library pages, and user-generated pages – but it also appears on your Site Settings page, Edit View page, and most administration pages served from the _layouts directory on the server. As a result, you create the design once and users see it throughout the site.

Master page layout uses DIV tags – The default primary master page in SharePoint uses DIV tags to define block-line elements and sections on the page. DIV tags offer a number of advantages over table tags, which were used in previous versions. For starters, there is more flexibility in how you style the page with CSS, less markup, faster downloads, improved search engine optimization, improved accessibility support, and improved browser support. HTML tables are still used, for example, when you or your users insert Web Parts and other SharePoint content on the page. But for designing and branding master pages, you can work primarily with the DIV tags to structure the content.

Master page features in SharePoint Designer – There are number of features in SharePoint Designer that make it easier to create and customize master pages. The navigation menu now includes a Master Pages category that takes you directly to the Master Page Gallery on your site. When editing master pages, you can use new page editing tools to insert and manage layers, or position DIV tags; and you can quickly locate those layers and other elements using the Skewer Click option. When you create new site and Web Part Pages in SharePoint Designer , they’re now automatically associated with the primary master page so you don’t have to manually associate them each time.

Restricting access to master pages – If you want to restrict master page customization using SharePoint Designer , you can do this using the new SharePoint Designer Settings page. This page is available on the Site Settings page for the site collection as well as in Central Administration. You can hide master pages and page layouts, prevent detaching of site pages, and hide the URL site hierarchy in SharePoint Designer or completely disable SharePoint Designer , as explained next.

Top of Page

Restricting access to SharePoint master pages

Master pages are a powerful way to design and brand SharePoint sites, so you may not want to allow everyone in your organization to customize these files. For starters, they could potentially break multiple SharePoint pages or sites if they delete a content placeholder control or script from a master page (instead of hiding it). They might customize their sites’ master pages to the point where they are no longer recognizable as belonging to the corporate intranet, which could affect a user’s experience when visiting that site. Or, you may simply want to prevent any user from creating new master pages because these pages will need to be maintained and updated, which adds to the overall maintenance costs of your SharePoint implementation.

By default, only Site Collection Administrators, members of the Designers group, and members of the Site Owners group can open a SharePoint site with SharePoint Designer and, if they like, customize the default master pages. To further restrict who can customize master pages in SharePoint Designer , use the SharePoint Designer Settings page, located on the Site Settings page for the site collection as well as in Central Administration.

There are two pages so that you can specify the level (web application or site collection) and the types of users (site collection administrators or designers and owners) to be restricted in SharePoint Designer , as shown here.

SharePoint Designer Settings page

Types of sites and users affected

Central Administration

Restricts SharePoint Designer for Site Collection Administrators at the web application level, which includes all site collections and sites in that web application.

Site Collection Administration

Restricts SharePoint Designer for all Site Owners and Designers at the site collection level, which includes all sites within the collection.

Note:  These settings are dependent on SharePoint Designer first being enabled in Central Administration.

To prevent users from customizing master pages on your SharePoint sites, you can uncheck the Enable Customizing Master Pages and Layout Pages on one or both of the SharePoint Designer Settings pages. When this option is disabled, users will no longer see the Master Pages or Page Layouts links in the Navigation pane of SharePoint Designer.

SharePoint master pages

Note:  Page Layouts only display for publishing-enabled pages in SharePoint Designer

In addition to disabling master pages and page layouts, you can use the SharePoint Designer Settings page to disable the site URL hierarchy, which hides the All Files option in the Navigation pane. You can also prevent pages from being detached from their site definition by disabling the Edit File in Advanced Mode for all site pages. Lastly, you can completely disable SharePoint Designer so that it can’t open and customize your SharePoint sites or portions of those sites.

In sum, use the SharePoint Designer Settings page to control who can create and customize the default master pages in SharePoint to best support your corporate design and brand.

Top of Page

Customizing master pages

Master pages control the look and feel of SharePoint sites. There are a handful of master pages available for different purposes, like publishing sites and search center sites, but the primary master page is v4.master. This page provides the overall SharePoint look and feel, including the placement of a site’s title, logo, navigation menus, main body area, and the SharePoint ribbon. The primary master page does this for all content pages, like the home page or any user-generated views, and administration pages, like the Site Settings page or View All Site Content page.

The colors, graphics, text formatting, and other layout properties are specified in one or more Cascading Style Sheets (CSS) that accompany the master page. Most of the styles applied to the default primary master page originate from the core SharePoint CSS file, corev4.css. To style the contents of a master page, you override these styles and introduce new styles in your own style sheets. In sum, designing and branding a SharePoint sites typically involves customizing both the default primary master page and the styles associated with that master page.

How customized master pages are managed in SharePoint

Before you start customizing master pages, it’s helpful to understand how default master pages are stored and managed in SharePoint as this can affect your server’s performance and future administration. The default primary master page, v4.master, is part of a site definition that is stored on the server running SharePoint (the actual location is %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\GLOBAL\ directory). The site definition files are cached in memory on the server when first accessed at runtime, and the information in each file is pulled from the cache for each subsequent request. This allows the page to be reused across multiple sites and reduces unnecessary storage and retrieval of the page. All of this improves the performance and scalability of SharePoint. Learn more in the MSDN article, Site Definitions and Configurations.

When a master page is customized for the first time, a new edited copy of the page is stored in SharePoint’s content database instead of the server’s file system. This is why you see a message the first time you customize a master page in SharePoint Designer , warning that you’re about to customize a page and it will no longer be based on the site definition. When you continue, you create the edited version in the content database which will be used for your sites pages instead of the original master page. This does not affect other SharePoint sites that are still using the original master page. If, at any time, you want to revert to the original master page and no longer use your customized master page, you can reset the master page to its site definition. This brings your site back to its original state and at the same time, creates a copy of your customized master page and places it in the Master Page Gallery in case you want to use it again.

Different approaches to customizing master pages

To customize the primary master page in SharePoint , you can use the v4.master page as your starting point by customizing a copy of it, or you can create a new custom master page from scratch, and make it the primary master page for your site. There are advantages and disadvantages to both approaches as explained here.

  1. By customizing a copy of v4.master, you’re using the existing SharePoint look and feel, with its features, brand, and design elements, and customizing it to meet your needs. While it can be challenging as you try to understand how everything works in the v4.master page, this approach is useful for minimal branding or customization efforts, like changing the header of your SharePoint pages.

  2. By creating a blank custom master page or by using the Starter Master Page (explained earlier) as the basis of your page, you’re creating the whole design from scratch. While this approach can be challenging because you need to know how to implement a design in SharePoint, it’s also more flexible when you know the design you’re trying to create and you’re working off existing plans and prototypes. The mostly empty page acts like a canvas for you to first build your design and then add the required SharePoint components.

Customizing master pages in SharePoint Designer

To customize master pages in SharePoint Designer , you first open SharePoint Designer from the site itself or from your Start menu. With your site open in SharePoint Designer , click Master Pages in the Navigation pane. If you don’t see Master Pages in the Navigation pane, make sure they are enabled on the site (as explained earlier).

For most sites, you see three master pages, v4.master, minimal.master, and default.master, in the Master Page Gallery as shown here.

SharePoint master pages

To view the contents of the primary master page, click v4.master or first make a copy of it and then open the copy. This opens the master page in the SharePoint Designer full-screen page editor where you can edit the page in Design view, Split view, or Code view. With design-time support, you can see what the master page looks like as you customize it. There are also tools available for you to navigate and customize tags, styles, scripts, and content regions as shown here.

SharePoint master pages

When customizing a master page, you can add new content and functionality, change the placement of objects on the page, resize the Web Part Zones, and so on. For the most part, you’re changing the layout and positioning of elements on the page. To customize the colors, graphics, text formatting, and other style attributes, you can create your own custom styles and add them to the master page directly or place them in external Cascading Style Sheets (CSS) that you attach to the master page.

When you are finished customizing the primary master page, you’ll want to consider the master pages used for search sites and publishing sites (as explained earlier) and whether to implement a similar design or an entirely new design.

When you customize master pages, just keep in mind the range of content and types of features that will appear on the site – such as home pages, document libraries, calendar views, and administration pages. Sites are also dynamic, allowing users to add their own content, Web Parts, embedded applications, and even sub-sites. Your customized master page needs to be able to render this content and functionality while providing a good user experience.

Top of Page

Deploying a customized master page

When you finish customizing a master page, the next step is to deploy it to SharePoint. One option is to save and reuse the master page by applying it to individual sites from SharePoint Designer , or if you’re running SharePoint Server , apply it to the site collection from the Site Master Page Settings page.

A more robust, scalable approach is to deploy the master page as a solution package and then activate it as a SharePoint feature. Then, when you want to install or uninstall the master page, you just activate or deactivate that feature. This approach requires using Microsoft Visual Studio to create the necessary modules, deployment XML, and event receivers for the feature.

With this approach, you can better update and manage your master pages across one or more SharePoint sites and site collections. Learn more in the MSDN article, How to Provision a File.

Top of Page

Sours: https://support.microsoft.com/en-us/office/introduction-to-sharepoint-master-pages-dc9cdceb8-abb8-eedab1a7

Master page sharepoint

Apply a master page to a site in SharePoint

Important

This extensibility option is only available for classic SharePoint experiences. You cannot use this option with modern experiences in SharePoint Online, like with communication sites. We do not recommend using classic experience or these branding techniques anymore.

Learn how to map a master page to a SharePoint site.

Mapping a master page to a site

In SharePoint, a master page defines the shared framing elements such as the chrome for all pages in your site. After a master page is created, it can be mapped to a site. This could be for all publishing pages designated for all users, or for the administrative pages used for site maintenance. Alternatively, if you are configuring a child site of a parent site, you can inherit the master page from the parent. This article provides the steps to map a created master page to a site, inherit the master page from a parent site, or map a master page to a specific device channel.

To map a master page to a SharePoint site

  1. In Site Settings for the designated site, under the Look and Feel section, choose Master Page.

    Note

    If the Master Page link is not there, you need to enable the publishing feature with these steps. Navigate to Site Settings | Site Collection Administration | Site Collection Features. Scroll down to the SharePoint Server Publishing Infrastructure feature and press Activate.

  2. On Site Master Page Settings, select one of the two options for the Site Master Page or System Master Page sections:

  • Inherit site master page from parent site Choose this option if you are configuring a child SharePoint site and want to use the parent master page.

    Note

    If you are working on the top-level parent site this option is unavailable.

  • Specify a master page to be used by this site and all sites that inherit from it Choose this option if you want to map a specific master page to the site, or if you want to map a specific master page for administrative pages. A drop-down box named Default or All Channels is available for you, depending on your site or system configuration, so you can select a specific master page stored in the master page gallery. Select the desired master page from the drop-down box.

    Note

    If you have any device channels configured, there are additional drop-down boxes available for additional master page mapping options.

  1. Choose OK.

See also

Feedback

View all page feedback

Sours: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-apply-a-master-page-to-a-site-in-sharepoint
How to create a Master Page in SharePoint Designer 2010

Create a minimal master page in SharePoint

Important

This extensibility option is only available for classic SharePoint experiences. You cannot use this option with modern experiences in SharePoint Online, like with communication sites. We do not recommend using classic experience or these branding techniques anymore.

A minimal master page contains only those page elements that are required by SharePoint to render the page correctly in the browser. With Design Manager, you can quickly create a minimal master page without first having to design and convert an HTML file.

Introduction to the minimal master page

With Design Manager, you can convert a typical HTML file into a SharePoint master page. But, if you don't have a prebuilt mock-up, you can still quickly start from scratch by creating a minimal master page. The minimal master page contains only those page elements required by SharePoint to render the page in the browser.

When you create a minimal master page, Design Manager creates both the .master file and an associated HTML file, so that you can still work with only the HTML file if you prefer. Working with a minimal master page is exactly the same as working with a master page that you convert from an HTML file. The HTML file and master page are associated, so that whenever you edit and save the HTML file, those changes are synced to the associated master page. And the HTML file contains special types of markup that make syncing with the .master file possible. For more information about this association and these types of markup, see How to: Convert an HTML file into a master page in SharePoint.

Starting with a minimal master page is useful when:

  • You want to start quickly from scratch, and then build out your design in the HTML file that's associated with the minimal master page, instead of starting with a mock-up HTML file.

  • You want to rapidly test or prototype a design element that requires a working SharePoint master page. For example, creating a minimal master page does not require preparing an HTML file for conversion or resolving any preview errors that result from markup that is not valid in the HTML file. This means you can immediately work with the server-side preview or the Snippet Gallery.

  • You want to work directly with the .master file. If you're an ASP.NET developer or a SharePoint developer, you can create a minimal master page, remove the association between the HTML file and the .master file by clearing the Associated File check box in the properties of the HTML file, and then work directly with the .master file.

Create a minimal master page

To create a minimal master page

  1. Browse to your publishing site.

  2. In the upper-right corner of the page, choose Settings, and then choose Design Manager.

  3. In Design Manager, in the left navigation pane, choose Edit Master Pages.

  4. Choose Create a minimal master page.

  5. In the Create a Master Page dialog box, enter a name for the master page, and then choose OK.

    At this point, SharePoint creates both a .master file and an associated HTML file with the same name in the Master Page Gallery.

    In Design Manager, your HTML file now appears with Conversion successful displayed in the Status column.

  6. Follow the link in the Status column to preview the file.

    The preview page is a live server-side preview of your master page.

    For more information about previewing the master page with different pages, see How to: Change the preview page in SharePoint Design Manager.

    The preview page also contains a Snippets link in the upper-right corner. This link opens the Snippet Gallery, where you can begin replacing static or mock-up controls in your design with dynamic SharePoint controls. For more information, see SharePoint Design Manager snippets.

    After your master page previews successfully, you will see a <div> tag that gets added to your HTML file. You may have to scroll to the bottom of the page to see the <div> tag.

    This <div> is the main content block. It resides inside a content placeholder named ContentPlaceHolderMain. At run time, when a visitor browses your site and requests a page, this content placeholder gets filled with content from a page layout that contains content in a matching content region. You should position this <div> where you want your page layouts to appear on the master page.

  7. You can edit the HTML file that resides directly on the server by using an HTML editor to open and edit the HTML file in a mapped drive. Each time you save the HTML file, any changes are synced to the associated .master file. For more information, see How to: Map a network drive to the SharePoint Master Page Gallery.

  8. To work only with the .master file and not the HTML file, you must break the association between the two files. In Design Manager, on the Edit Master Pages page, select the HTML file, open the Properties menu, and then choose Edit Properties. On the Edit tab, clear the Associated File check box, and then choose Save.

    Breaking the association enables you to work directly with the .master file and save changes without having them overwritten by any changes made to the HTML file. You can restore this association at any time. If you restore the association, the associated HTML file will sync to the .master file and overwrite it.

Understand the associated HTML file

When you create a minimal master page, an HTML file is created that's associated with the .master file, and this HTML file contains many lines of markup that are specific to how SharePoint works. You can safely ignore most of this markup, and most of it does not appear in the final markup of your site when you view source in the browser, but this markup is critical for syncing changes from the HTML file to the .master file that SharePoint actually uses. Each time you save a change to your HTML file, this SharePoint markup makes it possible for that same change to be made to the associated .master file in the background. For more information, see the markup samples in How to: Convert an HTML file into a master page in SharePoint.

See also

Feedback

View all page feedback

Sours: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-a-minimal-master-page-in-sharepoint

Similar news:

Overview: Master pages define page layout

Master pages define the common layout and interface for SharePoint pages.

The primary master page displays the persistent elements that you see when you navigate from page to page on a site, such as a company logo, title, navigation menu, search box, and the colors or graphics associated with the business or organization.

Other typical persistent elements include a sign-in link, the Site Actions menu, and the Ribbon commands in the same place on every subsite.

These elements are all stored in the primary master page.

The individual pages on a SharePoint site – the home page, a wiki page, a list view – are all handled as content pages on the site. When these pages are viewed in a browser, they are combined with the master page to produce a single, continuous web page.

The master page displays the persistent elements and layout, while the content pages display the unique, page-specific content.

View the primary master page

  1. Open your site in SharePoint Designer, and then click Master Pages in the Navigation pane.

  2. Click v4.master to see summary information in the Master Page Gallery.

  3. Click Edit File in the ribbon to open the master page.

This opens the master page in the SharePoint Designer full-screen page editor.

Here, you can edit the page in Design view, Split view, or Code view. With design-time support, you can see what the master page looks like as you customize it. There are also tools you can use to customize tags, styles, scripts, and content regions, as shown below:

SharePoint master pages

A number of features make it easier to create and customize master pages in SharePoint Designer than it has been in the past:

  • The navigation menu includes a Master Pages category that takes you directly to the Master Page Gallery on your site.

  • When editing master pages, you can use page editing tools to insert and manage layers, or position DIV tags; and you can quickly locate those layers and other elements using the Skewer Click option, which navigates through overlapping layers for you.

  • When you create a new site and Web Part Pages, they’re automatically associated with the primary master page, so you don’t have to manually associate them each time.

Customize or start from scratch?

To use a custom primary master page in your SharePoint sites, you can:

  • Customize a copy of the default primary master page (v4.master), or

  • Create a new custom master page from scratch, and make it the primary master page for your site.

This article focuses on the first approach: customizing a copy of the default primary master page.

There are advantages and disadvantages to both approaches.

When you customize a copy of v4.master,    you’re using the existing SharePoint look and feel, with its features, brand, and design elements, and customizing it to meet your needs. While it can be challenging as you try to understand how everything works in the v4.master page, this approach is useful for minimal branding or customization efforts, like changing the header of your SharePoint pages.

When you create a blank custom master page or develop your own starter master page as the basis of your page, you’re creating a design from scratch. While this approach can be challenging because you need to know how to implement a design in SharePoint, it’s also more flexible when you know the design you’re trying to create and you’re working off existing plans and prototypes. The mostly empty page acts like a canvas for you to first build your design and then add the required SharePoint components.

Default master pages in SharePoint

The v4.master page is the default primary master page in SharePoint It provides the SharePoint look and feel, interface, and functionality, including the ribbon – a new interface with menus, buttons, and commands similar to Microsoft Office applications. The primary master page is used for both content pages and application pages in SharePoint

Here are all the master pages that come with SharePoint

Name / default file name

Description

Uses on a SharePoint site

Primary master page

v4.master

Used for content and administration pages. Provides the interface and layout for SharePoint

Team Site home page, list and library pages, and site settings page.

Minimal master page

minimal.master

Contains minimal SharePoint content, used for full-screen functionality or embedded applications.

The home and search results pages on a Search Center, pages that host Word or Excel web applications.

Publishing master page

nightandday.master

Used for pages on a SharePoint Server publishing-enabled site.

The home page, about us, or press release page on a publishing intranet, extranet, or Internet-facing site.

default master page

default.master

Used to support legacy SharePoint sites, which haven’t been visually upgraded to SharePoint

Home page, site pages, and list pages on a SharePoint site before visual upgrade.

Note:  There is one more master page, simplev4.master, which is used for SharePoint-specific screens, like Login.aspx, Error.aspx, and Confirmation.aspx. This master page, however, is located on the server and cannot be customized in SharePoint Designer

Tip:  In addition to these master pages, you can download the Starter Master Page from MSDN. This master page contains the minimum required components, scripts, and placeholders to render a page in SharePoint. You might use this master page to create a whole new design from scratch. The page serves a similar purpose as the “minimal.master” page that was available in SharePoint

Top of Page

Customize the primary master page

To customize master pages in SharePoint Designer , you first open SharePoint Designer from the site itself or from your Start menu. With your site open in SharePoint Designer , click Master Pages in the Navigation pane.

For most sites, you see three master pages, v4.master, minimal.master, and default.master, in the Master Page Gallery as shown here.

SharePoint master pages

Create a copy of the primary master page

  1. Open your site in SharePoint Designer, and then click Master Pages in the Navigation Pane.

  2. Right-click v4.master and then press Ctrl+P to paste a copy into the Master Page Gallery.

  3. Click v4_copy(1).master to see summary information in the Master Page Gallery.

  4. Click Edit File in the ribbon to display the master page.

This opens the master page in the SharePoint Designer full-screen page editor where you can edit the page in Design view, Split view, or Code view. With design-time support, you can see what the master page looks like as you customize it. There are also tools available for you to navigate and customize tags, styles, scripts, and content regions as shown here.

Work with content placeholder controls

Master pages and content pages work together using a set of replaceable regions, or content placeholder controls. Each content placeholder (which appears as ContentPlaceHolder in the page code) represents content that can be overridden on the master page. Any page on the site can replace whatever is contained within the content placeholder by supplying a matching content control. That content control can even be empty, which would remove the element entirely from the rendered page.

Important:  When you customize master pages, avoid deleting content placeholders. Doing so might break some pages and even sites associated with the master page. It’s a good practice to simply hide instead of delete these controls..

You can use the Manage Content Regions feature to locate each content placeholder control on the page. You can view the control in both code view and the WYSIWYG editor.

Here you can see the PlaceHolderSiteName control that is used to display the name of the site.

SharePoint master pages

Another content placeholder that is particularly important is PlaceHolderMain because this is what gets replaced by each content page when that page is viewed in a web browser.

You can change the layout of content on a SharePoint site by changing the location of the content placeholder controls.

For more information about working with content placeholders, see Working with content placeholder controls.

A content placeholder control is a piece of code on a master page that works together with a content control on a content page. The content placeholder control displays default content (which can be no content, if the control is empty) for that region on the page but can be overridden by unique content from a content control on a content page.

SharePoint master pages

Locate and modify a content placeholder control

Follow these steps to locate the PlaceHolderSiteName content placeholder control on a SharePoint primary master page.

  1. Open your site in SharePoint Designer and in the navigation pane, click Master Pages.

    Note:  If you don’t see Master Pages in the navigation pane, they may have been disabled in SharePoint. Contact your site administrator for details. Learn more in Managing SharePoint Designer

  2. In the master page gallery, click v4.master.

  3. On the master page summary page, click Edit file.

  4. If you are prompted to check out the file, click Yes.

  5. If you’re viewing the page in Design view, you can simply click an area on the page to see the content placeholder control that serves up that content.

  6. Alternatively, you can browse the available content placeholder controls by clicking the Style tab and in the Master Page group, click Manage Content Regions. Using this feature, you can quickly and easily locate the content placeholder controls on the master page.

  7. In the list of content regions, select PlaceHolderSiteName and then click Go To. Then click Close. The content placeholder control is selected on the page like this.
    SharePoint master pages

  8. From here, you might change its settings, change the location, apply different styles, and so forth. When finished, save the master page.

  9. If you’re warned that the changes will customize the page from its site definition, choose Yes.

Note:  SharePoint pages are, by default, associated with site definition files. When a master page is customized in SharePoint Designer , it is no longer associated with the site definition. This can result in additional administrative work following future updates or upgrades to SharePoint, which is why you see this message. You can always reset the master page to its site definition, if necessary.


Your changes will appear on every page attached to this master page unless those pages were customized directly.

Work with styles

The easiest and quickest way to change the styles in your master page is to apply a predesigned theme to the page. You can see and apply available themes by clicking the Change site theme link under Customization on the Site Settings tab in SharePoint Designer.

But if you’re matching corporate colors, graphics, text formatting, or other style attributes, you’ll probably want to either create your own custom styles and add them to the master page directly, or place them in external Cascading Style Sheets (CSS) that you attach to the master page.

DIV tags streamline working with CSS

The default primary master page in SharePoint uses DIV tags to define block-line elements and sections on the page. DIV tags offer a number of advantages over table tags, which were used in previous versions. With DIV tags, there is:

  • More flexibility in how you style the page with CSS

  • Less markup

  • Faster downloads

  • Improved search engine optimization,

  • Improved accessibility support, and

  • Improved browser support.

HTML tables are still used, for example, when you or your users insert Web Parts and other SharePoint content on the page. But for customizing master pages, you can work primarily with the DIV tags to structure the content.

Edit styles in the master page or create a custom CSS

To edit styles, click the Style menu and then choose from among the options on the ribbon to work with CSS the way you want.

You can create new styles and apply then, or attach a style sheet using commands on the ribbon. Use the Manage Styles command to categorize styles by element, order or type; to show only styles in use on the page or element, and to see previews of styles.

Set your new master page as the primary master page

After you create a new master page in SharePoint Designer , you can quickly make the new master page the primary master page for the entire site.

Note:  When you set a new master page as the primary master page, all of the pages that are attached to the default primary master page, including the pages that already exist in your site and any new pages that you create, are attached to the new master page..

  1. Open SharePoint Designer and open the SharePoint site.

  2. Under Site Objects, in the Navigation Pane, click Master Pages.

  3. In the Master Pages list in the Navigation Pane, right-click the master page you want to make the default primary master, and then click Set As Default Master Page.

  4. Return to your SharePoint site and note that the primary default master has changed.

Sours: https://support.microsoft.com/en-us/office/customize-a-master-page-to-brand-your-site-0a57bcaf9-afedf3dfd1dd5


2896 2897 2898 2899 2900