Class PublishingExtensions
Class for publishing extension methods
Inheritance
System.Object
PublishingExtensions
Assembly: PnP.Framework.dll
Syntax
public static class PublishingExtensions : object
Methods
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.
|
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
|
Returns all image renditions
Declaration
public static IList<ImageRendition> GetPublishingImageRenditions(this Web web)
Parameters
Returns
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.
|
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.
|
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
|