Search Results for

    Show / Hide Table of Contents

    Class PublishingExtensions

    Class for publishing extension methods

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

    Methods

    AddPublishingPage(Web, String, String, String, Boolean, Folder, Nullable<DateTime>, Nullable<DateTime>, Boolean)

    Adds the publishing page.

    Declaration
    public static void AddPublishingPage(this Web web, string pageName, string pageTemplateName, string title = null, bool publish = false, Folder folder = null, DateTime? startDate = null, DateTime? endDate = null, Boolean schedule = null)
    Parameters
    Web web

    The web.

    System.String pageName

    Name of the page.

    System.String pageTemplateName

    Name of the page template/layout excluded the .aspx file extension.

    System.String title

    The title of the target publishing page.

    System.Boolean publish

    Should the page be published or not?

    Folder folder

    The target folder for the page, within the Pages library.

    System.Nullable<DateTime> startDate

    Start date for scheduled publishing.

    System.Nullable<DateTime> endDate

    End date for scheduled publishing.

    Boolean schedule

    Defines whether to define a schedule or not.

    CreatePublishingImageRendition(Web, String, Int32, Int32)

    Creates an Image Rendition if the name of the Image Rendition doesn't already exist.

    Declaration
    public static void CreatePublishingImageRendition(this Web web, string imageRenditionName, int imageRenditionWidth, int imageRenditionHeight)
    Parameters
    Web web

    SharePoint Web

    System.String imageRenditionName

    The display name of the Image Rendition

    System.Int32 imageRenditionWidth

    The width of the Image Rendition

    System.Int32 imageRenditionHeight

    The height of the Image Rendition

    GetPublishingImageRenditions(Web)

    Returns all image renditions

    Declaration
    public static IList<ImageRendition> GetPublishingImageRenditions(this Web web)
    Parameters
    Web web

    SharePoint Web

    Returns
    IList<ImageRendition>

    GetPublishingPage(Web, String)

    Gets a Publishing Page from the root folder of the Pages library.

    Declaration
    public static PublishingPage GetPublishingPage(this Web web, string fileLeafRef)
    Parameters
    Web web

    The web.

    System.String fileLeafRef

    The file leaf reference.

    Returns
    PublishingPage

    The PublishingPage object, if any. Otherwise null.

    GetPublishingPage(Web, String, Folder)

    Gets a Publishing Page from any folder in the Pages library.

    Declaration
    public static PublishingPage GetPublishingPage(this Web web, string fileLeafRef, Folder folder)
    Parameters
    Web web

    The web.

    System.String fileLeafRef

    The file leaf reference.

    Folder folder

    The folder where to search the page.

    Returns
    PublishingPage

    The PublishingPage object, if any. Otherwise null.

    RemovePublishingImageRendition(Web, String)

    Removes an existing image rendition

    Declaration
    public static void RemovePublishingImageRendition(this Web web, string imageRenditionName)
    Parameters
    Web web

    SharePoint Web

    System.String imageRenditionName

    The name of the image rendition

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