Interface IPage
A modern SharePoint Page
Namespace: PnP.Core.Model.SharePoint
Assembly: PnP.Core.dll
Syntax
public interface IPage
A modern SharePoint Page
public interface IPage
List of control on this page
List<ICanvasControl> Controls { get; }
Pn
|
The default section of the client side page
ICanvasSection DefaultSection { get; }
Returns the editor that was used to create/update this page
EditorType EditorType { get; }
Entity id field for topic pages
string EntityId { get; set; }
System.
|
Entity relations field for topic pages
string EntityRelations { get; set; }
System.
|
Entity type field for topic pages
string EntityType { get; set; }
System.
|
Folder the page lives in (available after saving the page)
string Folder { get; }
System.
|
List of controls on this page's header
List<ICanvasControl> HeaderControls { get; }
Pn
|
When a page of type Home is created you can opt to only keep the default client side web parts by setting this to true. This also is a way to reset your home page back the the stock one.
bool KeepDefaultWebParts { get; set; }
System.
|
Layout type of the client side page
PageLayoutType LayoutType { get; set; }
The name of this page (available after saving the page)
string Name { get; }
System.
|
Returns the page header for this page
IPageHeader PageHeader { get; }
ID value of the page (only available when the page was saved)
int? PageId { get; }
System.
|
Title of the client side page
string PageTitle { get; set; }
System.
|
Description of the repost page
string RepostDescription { get; set; }
System.
|
Id of the SharePoint IList
Guid RepostSourceItemId { get; set; }
Guid
|
Id of the SharePoint IList containting the page being reposted
Guid RepostSourceListId { get; set; }
Guid
|
Id of the SharePoint ISite containting the page being reposted
Guid RepostSourceSiteId { get; set; }
Guid
|
Url being reposted using the repost page
string RepostSourceUrl { get; set; }
System.
|
Id of the SharePoint IWeb containting the page being reposted
Guid RepostSourceWebId { get; set; }
Guid
|
Returns the scheduled publish data of a page (only if publish was scheduled)
DateTime? ScheduledPublishDate { get; }
System.
|
List of sections on this page
List<ICanvasSection> Sections { get; }
Pn
|
Space content field (JSON) for spaces pages
string SpaceContent { get; set; }
System.
|
Thumbnail url for the page
string ThumbnailUrl { get; set; }
System.
|
Adds a new control to your client side page using the default ICanvas
void AddControl(ICanvasControl control)
ICanvas ICanvas |
Adds a new control to your client side page in the given section
void AddControl(ICanvasControl control, ICanvasColumn column)
ICanvas ICanvas |
ICanvas ICanvas |
Adds a new control to your client side page in the given section with a given order
void AddControl(ICanvasControl control, ICanvasColumn column, int order)
ICanvas ICanvas |
ICanvas ICanvas |
System. Order of the control in the given section |
Adds a new control to your client side page in the given section
void AddControl(ICanvasControl control, ICanvasSection section)
ICanvas ICanvas |
ICanvas ICanvas |
Adds a new control to your client side page in the given section with a given order
void AddControl(ICanvasControl control, ICanvasSection section, int order)
ICanvas ICanvas |
ICanvas ICanvas |
System. Order of the control in the given section |
Adds a new control to your client side page using the default ICanvas
void AddControl(ICanvasControl control, int order)
ICanvas ICanvas |
System. Order of the control in the default section |
Adds a new header control to your client side page with a given order. Used for topic page creation
void AddHeaderControl(ICanvasControl control, int order)
ICanvas ICanvas |
System. Order of the control in the given section |
Adds a new section to your client side page
void AddSection(CanvasSectionTemplate sectionTemplate, float order)
Canvas The Canvas |
System. Controls the order of the new section |
Adds a new section to your client side page
void AddSection(CanvasSectionTemplate sectionTemplate, float order, VariantThemeType zoneEmphasis, VariantThemeType verticalSectionZoneEmphasis = default(VariantThemeType))
Canvas The Canvas |
System. Controls the order of the new section |
Variant Zone emphasis (section background) |
Variant Vertical Section Zone emphasis (section background) |
Adds a new section to your client side page
void AddSection(CanvasSectionTemplate sectionTemplate, float order, int zoneEmphasis, int? verticalSectionZoneEmphasis = null)
Canvas The Canvas |
System. Controls the order of the new section |
System. Zone emphasis (section background) |
System. Vertical Section Zone emphasis (section background) |
Adds a new section to your client side page
void AddSection(ICanvasSection section)
ICanvas ICanvas |
Adds a new section to your client side page with a given order
void AddSection(ICanvasSection section, float order)
ICanvas ICanvas |
System. Controls the order of the new section |
Does this page have comments disabled
bool AreCommentsDisabled()
System.
|
Does this page have comments disabled
Task<bool> AreCommentsDisabledAsync()
Task<System.
|
Gets a list of available client side web parts to use, optionally filtered by a given name
IEnumerable<IPageComponent> AvailablePageComponents(string name = null)
System. Name of the web part to retrieve |
IEnumerable<IPage List of available IPage |
Gets a list of available client side web parts to use, optionally filtered by a given name
Task<IEnumerable<IPageComponent>> AvailablePageComponentsAsync(string name = null)
System. Name of the web part to retrieve |
Task<IEnumerable<IPage List of available IPage |
Clears the sections and controls from the page
void ClearPage()
Translates a given Default
string DefaultWebPartToWebPartId(DefaultWebPart webPart)
Default Default |
System. The corresponding web part id |
Deletes the created page
void Delete()
Deletes the created page
Task DeleteAsync()
Task
|
Demotes an client side Article news page as a regular client side page
void DemoteNewsArticle()
Demotes an client side Article news page as a regular client side page
Task DemoteNewsArticleAsync()
Task
|
Disable commenting on this page
void DisableComments()
Disable commenting on this page
Task DisableCommentsAsync()
Task
|
Enable commenting on this page
void EnableComments()
Enable commenting on this page
Task EnableCommentsAsync()
Task
|
Get list item comments
ICommentCollection GetComments(params Expression<Func<IComment, object>>[] selectors)
Expression<Func<IComment, System. The expressions declaring the fields to select |
Get list item comments
Task<ICommentCollection> GetCommentsAsync(params Expression<Func<IComment, object>>[] selectors)
Expression<Func<IComment, System. The expressions declaring the fields to select |
Task<IComment
|
Prepares an Image web part for adding to a page
IPageWebPart GetImageWebPart(string serverRelativeUrl, PageImageOptions imageOptions = null)
System. Server relative url of the image to show in the image web part |
Page Options to configure the image when being added |
IPage Configured image web part which can be added to the page |
Prepares an Image web part for adding to a page
Task<IPageWebPart> GetImageWebPartAsync(string serverRelativeUrl, PageImageOptions imageOptions = null)
System. Server relative url of the image to show in the image web part |
Page Options to configure the image when being added |
Task<IPage Configured image web part which can be added to the page |
Prepares an inline image for adding to text by adding the needed image web part and returning the HTML snippet that needs to be appended to the text editor content
string GetInlineImage(IPageText textEditorInstance, string serverRelativeUrl, PageImageOptions imageOptions = null)
IPage Text editor instance to add the inline image to |
System. Server relative url of the image to add inline |
Page Options to configure the inline image when being added |
System. Html snippet to be appended to the text editor content |
Prepares an inline image for adding to text by adding the needed image web part and returning the HTML snippet that needs to be appended to the text editor content
Task<string> GetInlineImageAsync(IPageText textEditorInstance, string serverRelativeUrl, PageImageOptions imageOptions = null)
IPage Text editor instance to add the inline image to, when the Pn |
System. Server relative url of the image to add inline |
Page Options to configure the inline image when being added |
Task<System. Html snippet to be appended to the text editor content |
Returns information about the likes on this page
ILikedByInformation GetLikedByInformation()
Returns information about the likes on this page
Task<ILikedByInformation> GetLikedByInformationAsync()
Task<ILiked
|
Gets the file connected to this page
IFile GetPageFile(params Expression<Func<IFile, object>>[] expressions)
Expression<Func<IFile, System. Properties to load for the file |
Gets the file connected to this page
Task<IFile> GetPageFileAsync(params Expression<Func<IFile, object>>[] expressions)
Expression<Func<IFile, System. Properties to load for the file |
Returns the page translation status for a given page
IPageTranslationStatusCollection GetPageTranslations()
IPage IPage |
Returns the page translation status for a given page
Task<IPageTranslationStatusCollection> GetPageTranslationsAsync()
Task<IPage IPage |
Returns the name of the templates folder, and creates if it doesn't exist.
string GetTemplatesFolder()
System.
|
Returns the name of the templates folder, and creates if it doesn't exist.
Task<string> GetTemplatesFolderAsync()
Task<System.
|
Instantiates a new web part with default data and returns it
IPageWebPart InstantiateDefaultWebPart(DefaultWebPart webPart)
Default Default web part to instantiate |
IPage Instantiated web part |
Instantiates a new web part with default data and returns it
Task<IPageWebPart> InstantiateDefaultWebPartAsync(DefaultWebPart webPart)
Default Default web part to instantiate |
Task<IPage Instantiated web part |
Likes a page
void Like()
Likes a page
Task LikeAsync()
Task
|
Creates a new section background image web part
IPageWebPart NewSectionBackgroundControl()
IPage The created web part |
Creates a new text part which can be configured and added to the page
IPageText NewTextPart(string text = null)
System. Optionally provide the text for the text part |
IPage The created text part |
Creates a new web part
IPageWebPart NewWebPart(IPageComponent clientSideComponent = null)
IPage The base component to use for this web part |
IPage The created web part |
Sets the current IPage as home page for the current site
Task PromoteAsHomePageAsync()
Task
|
Promotes a regular Article client side page as a news page
Task PromoteAsNewsArticleAsync()
Task
|
Publishes a client side page
void Publish(string comment = null)
System. Publishing comment |
Publishes a client side page
Task PublishAsync(string comment = null)
System. Publishing comment |
Task
|
Removes the set page header by setting the page banner web part to "Plain" mode
void RemovePageHeader()
Removes the publication schedule of a client side page
void RemoveSchedulePublish()
Removes the publication schedule of a client side page
Task RemoveSchedulePublishAsync()
Task
|
Saves the page to the pages library
string Save(string pageName = null)
System. Page name to use |
System. The name of the saved page |
Saves the page as a template page
string SaveAsTemplate(string pageName = null)
System. Page name to use |
System. The name of the saved page |
Saves the page as a template page
Task<string> SaveAsTemplateAsync(string pageName = null)
System. Page name to use |
Task<System. The name of the saved page |
Saves the page to the pages library
Task<string> SaveAsync(string pageName = null)
System. Page name to use |
Task<System. The name of the saved page |
Schedules the publication of a client side page
void SchedulePublish(DateTime publishDate)
Date Date when the page needs to be publishing |
Schedules the publication of a client side page
Task SchedulePublishAsync(DateTime publishDate)
Date Date when the page needs to be publishing |
Task
|
Sets page header with custom focal point
void SetCustomPageHeader(string serverRelativeImageUrl, double? translateX = null, double? translateY = null)
System. Server relative page header image url |
System. X focal point for image |
System. Y focal point for image |
Sets page header back to the default page header
void SetDefaultPageHeader()
Sets page header back to the default for PageTilte WebPart (Message ID: MC791596 / Roadmap ID: 386904). The PageTitle WebPart has to be added into a first OneColumnFullWith Section separate.
void SetPageTitleWebPartPageHeader()
Creates page translations for all the languages defined as multi-lingual languages in the site
IPageTranslationStatusCollection TranslatePages()
IPage IPage |
Creates page translations for the requested languages
IPageTranslationStatusCollection TranslatePages(PageTranslationOptions pageTranslationOptions)
Page Options describing the languages in which a translation needs to be created |
IPage IPage |
Creates page translations for all the languages defined as multi-lingual languages in the site
Task<IPageTranslationStatusCollection> TranslatePagesAsync()
Task<IPage IPage |
Creates page translations for the requested languages
Task<IPageTranslationStatusCollection> TranslatePagesAsync(PageTranslationOptions pageTranslationOptions)
Page Options describing the languages in which a translation needs to be created |
Task<IPage IPage |
Unlikes a page
void Unlike()
Unlikes a page
Task UnlikeAsync()
Task
|
Translated a given web part id to a Default
DefaultWebPart WebPartIdToDefaultWebPart(string id)
System. Web part id to lookup |
Default Corresponding Default |