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
Class for publishing extension methods
public static class PublishingExtensions : object
Adds the publishing page.
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)
|
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.
public static void CreatePublishingImageRendition(this Web web, string imageRenditionName, int imageRenditionWidth, int imageRenditionHeight)
|
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
public static IList<ImageRendition> GetPublishingImageRenditions(this Web web)
|
Web
web
SharePoint Web |
|
IList<ImageRendition>
|
Gets a Publishing Page from the root folder of the Pages library.
public static PublishingPage GetPublishingPage(this Web web, string fileLeafRef)
|
Web
web
The web. |
|
System.String
fileLeafRef
The file leaf reference. |
|
PublishingPage
The PublishingPage object, if any. Otherwise null. |
Gets a Publishing Page from any folder in the Pages library.
public static PublishingPage GetPublishingPage(this Web web, string fileLeafRef, Folder folder)
|
Web
web
The web. |
|
System.String
fileLeafRef
The file leaf reference. |
|
Folder
folder
The folder where to search the page. |
|
PublishingPage
The PublishingPage object, if any. Otherwise null. |
Removes an existing image rendition
public static void RemovePublishingImageRendition(this Web web, string imageRenditionName)
|
Web
web
SharePoint Web |
|
System.String
imageRenditionName
The name of the image rendition |