Search Results for

    Show / Hide Table of Contents

    Class BrandingExtensions

    Class that deals with branding features

    Inheritance
    System.Object
    BrandingExtensions
    Namespace: Microsoft.SharePoint.Client
    Assembly: PnP.Framework.dll
    Syntax
    public static class BrandingExtensions : object

    Methods

    AllowAllPageLayouts(Web)

    Allow the web to use all available page layouts

    Declaration
    public static void AllowAllPageLayouts(this Web web)
    Parameters
    Web web

    Web to operate against

    ClearAvailableWebTemplates(Web)

    Can be used to remote filters from the available web template

    Declaration
    public static void ClearAvailableWebTemplates(this Web web)
    Parameters
    Web web

    Web to process

    ComposedLookExists(Web, String)

    Checks if a composed look exists.

    Declaration
    public static bool ComposedLookExists(this Web web, string composedLookName)
    Parameters
    Web web

    Web to check

    System.String composedLookName

    Name of the composed look

    Returns
    System.Boolean

    true if it exists; otherwise false

    CreateComposedLookByName(Web, String, String, String, String, String, Int32, Boolean)

    Creates (or updates) a composed look in the web site; usually this is done in the root site of the collection.

    Declaration
    public static void CreateComposedLookByName(this Web web, string lookName, string paletteFileName, string fontFileName, string backgroundFileName, string masterFileName, int displayOrder = 1, bool replaceContent = true)
    Parameters
    Web web

    Web to create the composed look in

    System.String lookName

    Name of the theme

    System.String paletteFileName

    File name of the palette file in the theme catalog of the site collection; path component ignored.

    System.String fontFileName

    File name of the font file in the theme catalog of the site collection; path component ignored.

    System.String backgroundFileName

    File name of the background image file in the theme catalog of the site collection; path component ignored.

    System.String masterFileName

    File name of the master page in the mastepage catalog of the web site; path component ignored.

    System.Int32 displayOrder

    Display order of the composed look

    System.Boolean replaceContent

    Replace composed look if it already exists (default true)

    CreateComposedLookByUrl(Web, String, String, String, String, String, Int32, Boolean)

    Creates (or updates) a composed look in the web site; usually this is done in the root site of the collection.

    Declaration
    public static void CreateComposedLookByUrl(this Web web, string lookName, string paletteServerRelativeUrl, string fontServerRelativeUrl, string backgroundServerRelativeUrl, string masterServerRelativeUrl, int displayOrder = 1, bool replaceContent = true)
    Parameters
    Web web

    Web to create the composed look in

    System.String lookName

    Name of the theme

    System.String paletteServerRelativeUrl

    URL of the palette file, usually in the theme catalog of the site collection

    System.String fontServerRelativeUrl

    URL of the font file, usually in the theme catalog of the site collection

    System.String backgroundServerRelativeUrl

    URL of the background image file, usually in /_layouts/15/images

    System.String masterServerRelativeUrl

    URL of the master page, usually in the masterpage catalog of the web site

    System.Int32 displayOrder

    Display order of the composed look

    System.Boolean replaceContent

    Replace composed look if it already exists (default true)

    DeployHtmlPageLayout(Web, String, String, String, String, String)

    Can be used to deploy html page layouts to master page gallery. Should be only used with root web of site collection where publishing features are enabled.

    Declaration
    public static void DeployHtmlPageLayout(this Web web, string sourceFilePath, string title, string description, string associatedContentTypeID, string folderHierarchy = "")
    Parameters
    Web web

    Web as the root site of the publishing site collection

    System.String sourceFilePath

    Full path to the file which will be uploaded

    System.String title

    Title for the page layout

    System.String description

    Description for the page layout

    System.String associatedContentTypeID

    Associated content type ID

    System.String folderHierarchy

    Folder hierarchy where the html page layouts will be deployed

    DeployMasterPage(Web, String, String, String, String, String, String)

    Deploys a new masterpage

    Declaration
    public static File DeployMasterPage(this Web web, string sourceFilePath, string title, string description, string uiVersion = "15", string defaultCSSFile = "", string folderPath = "")
    Parameters
    Web web

    The web to process

    System.String sourceFilePath

    The path to the source file

    System.String title

    The title of the masterpage

    System.String description

    The description of the masterpage

    System.String uiVersion

    UIVersion of the masterpage

    System.String defaultCSSFile

    DefaultCSSFile of the masterpage

    System.String folderPath

    FolderPath of the masterpage

    Returns
    File

    DeployPageLayout(Web, String, String, String, String, String)

    Can be used to deploy page layouts to master page gallery. Should be only used with root web of site collection where publishing features are enabled.

    Declaration
    public static void DeployPageLayout(this Web web, string sourceFilePath, string title, string description, string associatedContentTypeID, string folderHierarchy = "")
    Parameters
    Web web

    Web as the root site of the publishing site collection

    System.String sourceFilePath

    Full path to the file which will be uploaded

    System.String title

    Title for the page layout

    System.String description

    Description for the page layout

    System.String associatedContentTypeID

    Associated content type ID

    System.String folderHierarchy

    Folder hierarchy where the page layouts will be deployed

    DisableReponsiveUI(Site)

    Disables the Responsive UI on a Classic SharePoint Site

    Declaration
    public static void DisableReponsiveUI(this Site site)
    Parameters
    Site site

    The Site to disable the Responsive UI on

    DisableReponsiveUI(Web)

    Disables the Responsive UI on a Classic SharePoint Web

    Declaration
    public static void DisableReponsiveUI(this Web web)
    Parameters
    Web web

    The Web to disable the Responsive UI on

    DisableResponsiveUI(Site)

    Disables the Responsive UI on a Classic SharePoint Site

    Declaration
    public static void DisableResponsiveUI(this Site site)
    Parameters
    Site site

    The Site to disable the Responsive UI on

    DisableResponsiveUI(Web)

    Disables the Responsive UI on a Classic SharePoint Web

    Declaration
    public static void DisableResponsiveUI(this Web web)
    Parameters
    Web web

    The Web to disable the Responsive UI on

    GetComposedLook(Web, String)

    Returns the named composed look from the web gallery

    Declaration
    public static ThemeEntity GetComposedLook(this Web web, string composedLookName)
    Parameters
    Web web

    Web to check

    System.String composedLookName

    Name of the composed look to retrieve

    Returns
    ThemeEntity

    Entity with the attributes of the composed look, or null if the composed look does not exists or cannot be determined

    GetCurrentComposedLook(Web)

    Returns the current theme of a web

    Declaration
    public static ThemeEntity GetCurrentComposedLook(this Web web)
    Parameters
    Web web

    Web to check

    Returns
    ThemeEntity

    Entity with attributes of current composed look, or null if none

    GetPageLayoutListItemByName(Web, String)

    Gets a page layout from the master page catalog. Can be called with paramter as "pagelayout.aspx" or as full path like "_catalog/masterpage/pagelayout.aspx"

    Declaration
    public static ListItem GetPageLayoutListItemByName(this Web web, string pageLayoutName)
    Parameters
    Web web

    root web

    System.String pageLayoutName

    name of the page layout to retrieve

    Returns
    ListItem

    ListItem holding the page layout, null if not found

    GetRelativeUrlForMasterByName(Web, String)

    Returns the relative URL for a masterpage

    Declaration
    public static string GetRelativeUrlForMasterByName(this Web web, string masterPageName)
    Parameters
    Web web

    Web to process

    System.String masterPageName

    The name of the masterpage, e.g. 'default' or 'seattle'

    Returns
    System.String

    SetAvailablePageLayouts(Web, Web, IEnumerable<String>)

    Sets the available page layouts

    Declaration
    public static void SetAvailablePageLayouts(this Web web, Web rootWeb, IEnumerable<string> pageLayouts)
    Parameters
    Web web

    The web to process

    Web rootWeb

    The rootweb

    IEnumerable<System.String> pageLayouts

    The page layouts to make available

    SetAvailableWebTemplates(Web, List<WebTemplateEntity>)

    Defines which templates are available for subsite creation

    Declaration
    public static void SetAvailableWebTemplates(this Web web, List<WebTemplateEntity> availableTemplates)
    Parameters
    Web web

    Web to operate against

    List<WebTemplateEntity> availableTemplates

    List of WebTemplateEntity objects that define the templates that are allowed

    SetComposedLookByUrl(Web, String, String, String, String, String, Boolean, Boolean)

    Retrieves the named composed look, overrides with specified palette, font, background and master page, and then recursively sets the specified values.

    Declaration
    public static void SetComposedLookByUrl(this Web web, string lookName, string paletteServerRelativeUrl = null, string fontServerRelativeUrl = null, string backgroundServerRelativeUrl = null, string masterServerRelativeUrl = null, bool resetSubsitesToInherit = false, bool updateRootOnly = true)
    Parameters
    Web web

    Web to apply composed look to

    System.String lookName

    Name of the composed look to apply; null will apply the override values only

    System.String paletteServerRelativeUrl

    Override palette file URL to use

    System.String fontServerRelativeUrl

    Override font file URL to use

    System.String backgroundServerRelativeUrl

    Override background image file URL to use

    System.String masterServerRelativeUrl

    Override master page file URL to use

    System.Boolean resetSubsitesToInherit

    false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

    System.Boolean updateRootOnly

    false to apply to subsites; true (default) to only apply to specified site

    SetCustomMasterPageByName(Web, String)

    Master page is set by using master page name. Master page is set from the current web.

    Declaration
    public static void SetCustomMasterPageByName(this Web web, string masterPageName)
    Parameters
    Web web

    Current web

    System.String masterPageName

    Name of the master page. Path is resolved from this.

    SetCustomMasterPageByUrl(Web, String, Boolean, Boolean)

    Set Custom master page by using given URL as parameter. Suitable for example in cases where you want sub sites to reference root site master page gallery. This is typical with publishing sites.

    Declaration
    public static void SetCustomMasterPageByUrl(this Web web, string masterPageServerRelativeUrl, bool resetSubsitesToInherit = false, bool updateRootOnly = false)
    Parameters
    Web web

    Context web

    System.String masterPageServerRelativeUrl

    URL to the master page.

    System.Boolean resetSubsitesToInherit

    false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

    System.Boolean updateRootOnly

    false (default) to apply to subsites; true to only apply to specified site

    SetDefaultPageLayoutForSite(Web, Web, String)

    Sets specific page layout the default page layout for the particular site

    Declaration
    public static void SetDefaultPageLayoutForSite(this Web web, Web rootWeb, string pageLayoutName)
    Parameters
    Web web

    Web to process

    Web rootWeb

    The rootWeb

    System.String pageLayoutName

    Name of the page layout

    SetHomePage(Web, String)

    Sets the web home page

    Declaration
    public static void SetHomePage(this Web web, string rootFolderRelativePath)
    Parameters
    Web web

    The Web to process

    System.String rootFolderRelativePath

    The path relative to the root folder of the site, e.g. SitePages/Home.aspx

    SetMasterPageByName(Web, String)

    Master page is set by using master page name. Master page is set from the current web.

    Declaration
    public static void SetMasterPageByName(this Web web, string masterPageName)
    Parameters
    Web web

    Current web

    System.String masterPageName

    Name of the master page. Path is resolved from this.

    SetMasterPageByUrl(Web, String, Boolean, Boolean)

    Set master page by using given URL as parameter. Suitable for example in cases where you want sub sites to reference root site master page gallery. This is typical with publishing sites.

    Declaration
    public static void SetMasterPageByUrl(this Web web, string masterPageServerRelativeUrl, bool resetSubsitesToInherit = false, bool updateRootOnly = false)
    Parameters
    Web web

    Context web

    System.String masterPageServerRelativeUrl

    URL to the master page.

    System.Boolean resetSubsitesToInherit

    false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

    System.Boolean updateRootOnly

    false (default) to apply to subsites; true to only apply to specified site

    SetMasterPagesByName(Web, String, String)

    Can be used to set master page and custom master page in single command

    Declaration
    public static void SetMasterPagesByName(this Web web, string masterPageName, string customMasterPageName)
    Parameters
    Web web

    Current web

    System.String masterPageName

    Name of the master page

    System.String customMasterPageName

    Name of the custom master page

    SetMasterPagesByUrl(Web, String, String)

    Can be used to set master page and custom master page in single command

    Declaration
    public static void SetMasterPagesByUrl(this Web web, string masterPageUrl, string customMasterPageUrl)
    Parameters
    Web web

    Current web

    System.String masterPageUrl

    Url of the master page

    System.String customMasterPageUrl

    Url of the custom master page

    SetSiteToInheritPageLayouts(Web)

    Can be used to set the site to inherit the default page layout option from parent. Cannot be used for root site of the site collection

    Declaration
    public static void SetSiteToInheritPageLayouts(this Web web)
    Parameters
    Web web

    Web to operate against

    SetThemeByUrl(Web, String, String, String, Boolean, Boolean)

    Recursively applies the specified palette, font, and background image.

    Declaration
    public static void SetThemeByUrl(this Web web, string paletteServerRelativeUrl, string fontServerRelativeUrl, string backgroundServerRelativeUrl, bool resetSubsitesToInherit = false, bool updateRootOnly = false)
    Parameters
    Web web

    Web to apply to

    System.String paletteServerRelativeUrl

    URL of palette file to apply

    System.String fontServerRelativeUrl

    URL of font file to apply

    System.String backgroundServerRelativeUrl

    URL of background image to apply

    System.Boolean resetSubsitesToInherit

    false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

    System.Boolean updateRootOnly

    false (default) to apply to subsites; true to only apply to specified site

    UploadThemeFile(Web, String, Stream, String)

    Uploads the specified file (usually an spcolor or spfont file) to the web site themes gallery (usually only exists in the root web of a site collection).

    Declaration
    public static File UploadThemeFile(this Web web, string fileName, Stream localStream, string themeFolderVersion = "15")
    Parameters
    Web web

    Web site to upload to

    System.String fileName

    Name of the file to upload

    Stream localStream

    Stream containing the contents of the file

    System.String themeFolderVersion

    Leaf folder name to upload to; default is "15"

    Returns
    File

    The uploaded file, with at least the ServerRelativeUrl property available

    UploadThemeFile(Web, String, String)

    Uploads the specified file (usually an spcolor or spfont file) to the web site themes gallery (usually only exists in the root web of a site collection).

    Declaration
    public static File UploadThemeFile(this Web web, string localFilePath, string themeFolderVersion = "15")
    Parameters
    Web web

    Web site to upload to

    System.String localFilePath

    Location of the file to be uploaded

    System.String themeFolderVersion

    Leaf folder name to upload to; default is "15"

    Returns
    File

    The uploaded file, with at least the ServerRelativeUrl property available

    UploadThemeFile(Web, String, String, String)

    Uploads the specified file (usually an spcolor or spfont file) to the web site themes gallery (usually only exists in the root web of a site collection).

    Declaration
    public static File UploadThemeFile(this Web web, string fileName, string localFilePath, string themeFolderVersion = "15")
    Parameters
    Web web

    Web site to upload to

    System.String fileName

    Name of the file to upload

    System.String localFilePath

    Location of the file to be uploaded

    System.String themeFolderVersion

    Leaf folder name to upload to; default is "15"

    Returns
    File

    The uploaded file, with at least the ServerRelativeUrl property available

    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer