Search Results for

    Show / Hide Table of Contents

    Interface IPage

    A modern SharePoint Page

    Namespace: PnP.Core.Model.SharePoint
    Assembly: PnP.Core.dll
    Syntax
    public interface IPage

    Properties

    Controls

    List of control on this page

    Declaration
    List<ICanvasControl> Controls { get; }
    Property Value
    PnP.Core.Model.SharePoint.List<ICanvasControl>

    DefaultSection

    The default section of the client side page

    Declaration
    ICanvasSection DefaultSection { get; }
    Property Value
    ICanvasSection

    EditorType

    Returns the editor that was used to create/update this page

    Declaration
    EditorType EditorType { get; }
    Property Value
    EditorType

    EntityId

    Entity id field for topic pages

    Declaration
    string EntityId { get; set; }
    Property Value
    String

    EntityRelations

    Entity relations field for topic pages

    Declaration
    string EntityRelations { get; set; }
    Property Value
    String

    EntityType

    Entity type field for topic pages

    Declaration
    string EntityType { get; set; }
    Property Value
    String

    Folder

    Folder the page lives in (available after saving the page)

    Declaration
    string Folder { get; }
    Property Value
    String

    HeaderControls

    List of controls on this page's header

    Declaration
    List<ICanvasControl> HeaderControls { get; }
    Property Value
    PnP.Core.Model.SharePoint.List<ICanvasControl>

    KeepDefaultWebParts

    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.

    Declaration
    bool KeepDefaultWebParts { get; set; }
    Property Value
    Boolean

    LayoutType

    Layout type of the client side page

    Declaration
    PageLayoutType LayoutType { get; set; }
    Property Value
    PageLayoutType

    Name

    The name of this page (available after saving the page)

    Declaration
    string Name { get; }
    Property Value
    String

    PageHeader

    Returns the page header for this page

    Declaration
    IPageHeader PageHeader { get; }
    Property Value
    IPageHeader

    PageId

    ID value of the page (only available when the page was saved)

    Declaration
    int? PageId { get; }
    Property Value
    Nullable<Int32>

    PageListItem

    ListItem linked to this page

    Declaration
    IListItem PageListItem { get; }
    Property Value
    IListItem

    PagesLibrary

    Pages library

    Declaration
    IList PagesLibrary { get; }
    Property Value
    IList

    PageTitle

    Title of the client side page

    Declaration
    string PageTitle { get; set; }
    Property Value
    String

    PnPContext

    PnPContext to work with

    Declaration
    PnPContext PnPContext { get; }
    Property Value
    PnPContext

    RepostDescription

    Description of the repost page

    Declaration
    string RepostDescription { get; set; }
    Property Value
    String

    RepostSourceItemId

    Id of the SharePoint IListItem connected to the page being reposted

    Declaration
    Guid RepostSourceItemId { get; set; }
    Property Value
    Guid

    RepostSourceListId

    Id of the SharePoint IList containting the page being reposted

    Declaration
    Guid RepostSourceListId { get; set; }
    Property Value
    Guid

    RepostSourceSiteId

    Id of the SharePoint ISite containting the page being reposted

    Declaration
    Guid RepostSourceSiteId { get; set; }
    Property Value
    Guid

    RepostSourceUrl

    Url being reposted using the repost page

    Declaration
    string RepostSourceUrl { get; set; }
    Property Value
    String

    RepostSourceWebId

    Id of the SharePoint IWeb containting the page being reposted

    Declaration
    Guid RepostSourceWebId { get; set; }
    Property Value
    Guid

    ScheduledPublishDate

    Returns the scheduled publish data of a page (only if publish was scheduled)

    Declaration
    DateTime? ScheduledPublishDate { get; }
    Property Value
    Nullable<DateTime>

    Sections

    List of sections on this page

    Declaration
    List<ICanvasSection> Sections { get; }
    Property Value
    PnP.Core.Model.SharePoint.List<ICanvasSection>

    SpaceContent

    Space content field (JSON) for spaces pages

    Declaration
    string SpaceContent { get; set; }
    Property Value
    String

    ThumbnailUrl

    Thumbnail url for the page

    Declaration
    string ThumbnailUrl { get; set; }
    Property Value
    String

    Methods

    AddControl(ICanvasControl)

    Adds a new control to your client side page using the default ICanvasSection

    Declaration
    void AddControl(ICanvasControl control)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    AddControl(ICanvasControl, ICanvasColumn)

    Adds a new control to your client side page in the given section

    Declaration
    void AddControl(ICanvasControl control, ICanvasColumn column)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    ICanvasColumn column

    ICanvasColumn that will hold the control

    AddControl(ICanvasControl, ICanvasColumn, Int32)

    Adds a new control to your client side page in the given section with a given order

    Declaration
    void AddControl(ICanvasControl control, ICanvasColumn column, int order)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    ICanvasColumn column

    ICanvasColumn that will hold the control

    Int32 order

    Order of the control in the given section

    AddControl(ICanvasControl, ICanvasSection)

    Adds a new control to your client side page in the given section

    Declaration
    void AddControl(ICanvasControl control, ICanvasSection section)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    ICanvasSection section

    ICanvasSection that will hold the control. Control will end up in the DefaultColumn.

    AddControl(ICanvasControl, ICanvasSection, Int32)

    Adds a new control to your client side page in the given section with a given order

    Declaration
    void AddControl(ICanvasControl control, ICanvasSection section, int order)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    ICanvasSection section

    ICanvasSection that will hold the control. Control will end up in the DefaultColumn.

    Int32 order

    Order of the control in the given section

    AddControl(ICanvasControl, Int32)

    Adds a new control to your client side page using the default ICanvasSection using a given order

    Declaration
    void AddControl(ICanvasControl control, int order)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    Int32 order

    Order of the control in the default section

    AddHeaderControl(ICanvasControl, Int32)

    Adds a new header control to your client side page with a given order. Used for topic page creation

    Declaration
    void AddHeaderControl(ICanvasControl control, int order)
    Parameters
    ICanvasControl control

    ICanvasControl to add

    Int32 order

    Order of the control in the given section

    AddSection(CanvasSectionTemplate, Single)

    Adds a new section to your client side page

    Declaration
    void AddSection(CanvasSectionTemplate sectionTemplate, float order)
    Parameters
    CanvasSectionTemplate sectionTemplate

    The CanvasSectionTemplate type of the section

    Single order

    Controls the order of the new section

    AddSection(CanvasSectionTemplate, Single, VariantThemeType, VariantThemeType)

    Adds a new section to your client side page

    Declaration
    void AddSection(CanvasSectionTemplate sectionTemplate, float order, VariantThemeType zoneEmphasis, VariantThemeType verticalSectionZoneEmphasis = default(VariantThemeType))
    Parameters
    CanvasSectionTemplate sectionTemplate

    The CanvasSectionTemplate type of the section

    Single order

    Controls the order of the new section

    VariantThemeType zoneEmphasis

    Zone emphasis (section background)

    VariantThemeType verticalSectionZoneEmphasis

    Vertical Section Zone emphasis (section background)

    AddSection(CanvasSectionTemplate, Single, Int32, Nullable<Int32>)

    Adds a new section to your client side page

    Declaration
    void AddSection(CanvasSectionTemplate sectionTemplate, float order, int zoneEmphasis, int? verticalSectionZoneEmphasis = null)
    Parameters
    CanvasSectionTemplate sectionTemplate

    The CanvasSectionTemplate type of the section

    Single order

    Controls the order of the new section

    Int32 zoneEmphasis

    Zone emphasis (section background)

    Nullable<Int32> verticalSectionZoneEmphasis

    Vertical Section Zone emphasis (section background)

    AddSection(ICanvasSection)

    Adds a new section to your client side page

    Declaration
    void AddSection(ICanvasSection section)
    Parameters
    ICanvasSection section

    ICanvasSection object describing the section to add

    AddSection(ICanvasSection, Single)

    Adds a new section to your client side page with a given order

    Declaration
    void AddSection(ICanvasSection section, float order)
    Parameters
    ICanvasSection section

    ICanvasSection object describing the section to add

    Single order

    Controls the order of the new section

    AreCommentsDisabled()

    Does this page have comments disabled

    Declaration
    bool AreCommentsDisabled()
    Returns
    Boolean

    AreCommentsDisabledAsync()

    Does this page have comments disabled

    Declaration
    Task<bool> AreCommentsDisabledAsync()
    Returns
    Task<Boolean>

    AvailablePageComponents(String)

    Gets a list of available client side web parts to use, optionally filtered by a given name

    Declaration
    IEnumerable<IPageComponent> AvailablePageComponents(string name = null)
    Parameters
    String name

    Name of the web part to retrieve

    Returns
    IEnumerable<IPageComponent>

    List of available IPageComponent

    AvailablePageComponentsAsync(String)

    Gets a list of available client side web parts to use, optionally filtered by a given name

    Declaration
    Task<IEnumerable<IPageComponent>> AvailablePageComponentsAsync(string name = null)
    Parameters
    String name

    Name of the web part to retrieve

    Returns
    Task<IEnumerable<IPageComponent>>

    List of available IPageComponent

    ClearPage()

    Clears the sections and controls from the page

    Declaration
    void ClearPage()

    DefaultWebPartToWebPartId(DefaultWebPart)

    Translates a given DefaultWebPart enum to it's corresponding web part id. Non default web parts will be returned as empty string

    Declaration
    string DefaultWebPartToWebPartId(DefaultWebPart webPart)
    Parameters
    DefaultWebPart webPart

    DefaultWebPart enum to translate to it's id

    Returns
    String

    The corresponding web part id

    Delete()

    Deletes the created page

    Declaration
    void Delete()

    DeleteAsync()

    Deletes the created page

    Declaration
    Task DeleteAsync()
    Returns
    Task

    DemoteNewsArticle()

    Demotes an client side Article news page as a regular client side page

    Declaration
    void DemoteNewsArticle()

    DemoteNewsArticleAsync()

    Demotes an client side Article news page as a regular client side page

    Declaration
    Task DemoteNewsArticleAsync()
    Returns
    Task

    DisableComments()

    Disable commenting on this page

    Declaration
    void DisableComments()

    DisableCommentsAsync()

    Disable commenting on this page

    Declaration
    Task DisableCommentsAsync()
    Returns
    Task

    EnableComments()

    Enable commenting on this page

    Declaration
    void EnableComments()

    EnableCommentsAsync()

    Enable commenting on this page

    Declaration
    Task EnableCommentsAsync()
    Returns
    Task

    GetComments(Expression<Func<IComment, Object>>[])

    Get list item comments

    Declaration
    ICommentCollection GetComments(params Expression<Func<IComment, object>>[] selectors)
    Parameters
    Expression<Func<IComment, Object>>[] selectors

    The expressions declaring the fields to select

    Returns
    ICommentCollection

    GetCommentsAsync(Expression<Func<IComment, Object>>[])

    Get list item comments

    Declaration
    Task<ICommentCollection> GetCommentsAsync(params Expression<Func<IComment, object>>[] selectors)
    Parameters
    Expression<Func<IComment, Object>>[] selectors

    The expressions declaring the fields to select

    Returns
    Task<ICommentCollection>

    GetImageWebPart(String, PageImageOptions)

    Prepares an Image web part for adding to a page

    Declaration
    IPageWebPart GetImageWebPart(string serverRelativeUrl, PageImageOptions imageOptions = null)
    Parameters
    String serverRelativeUrl

    Server relative url of the image to show in the image web part

    PageImageOptions imageOptions

    Options to configure the image when being added

    Returns
    IPageWebPart

    Configured image web part which can be added to the page

    GetImageWebPartAsync(String, PageImageOptions)

    Prepares an Image web part for adding to a page

    Declaration
    Task<IPageWebPart> GetImageWebPartAsync(string serverRelativeUrl, PageImageOptions imageOptions = null)
    Parameters
    String serverRelativeUrl

    Server relative url of the image to show in the image web part

    PageImageOptions imageOptions

    Options to configure the image when being added

    Returns
    Task<IPageWebPart>

    Configured image web part which can be added to the page

    GetInlineImage(IPageText, String, PageImageOptions)

    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

    Declaration
    string GetInlineImage(IPageText textEditorInstance, string serverRelativeUrl, PageImageOptions imageOptions = null)
    Parameters
    IPageText textEditorInstance

    Text editor instance to add the inline image to

    String serverRelativeUrl

    Server relative url of the image to add inline

    PageImageOptions imageOptions

    Options to configure the inline image when being added

    Returns
    String

    Html snippet to be appended to the text editor content

    GetInlineImageAsync(IPageText, String, PageImageOptions)

    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

    Declaration
    Task<string> GetInlineImageAsync(IPageText textEditorInstance, string serverRelativeUrl, PageImageOptions imageOptions = null)
    Parameters
    IPageText textEditorInstance

    Text editor instance to add the inline image to, when the PnP.Core.Model.SharePoint.Page.EditorType is CK5 then this can be left null

    String serverRelativeUrl

    Server relative url of the image to add inline

    PageImageOptions imageOptions

    Options to configure the inline image when being added

    Returns
    Task<String>

    Html snippet to be appended to the text editor content

    GetLikedByInformation()

    Returns information about the likes on this page

    Declaration
    ILikedByInformation GetLikedByInformation()
    Returns
    ILikedByInformation

    GetLikedByInformationAsync()

    Returns information about the likes on this page

    Declaration
    Task<ILikedByInformation> GetLikedByInformationAsync()
    Returns
    Task<ILikedByInformation>

    GetPageFile(Expression<Func<IFile, Object>>[])

    Gets the file connected to this page

    Declaration
    IFile GetPageFile(params Expression<Func<IFile, object>>[] expressions)
    Parameters
    Expression<Func<IFile, Object>>[] expressions

    Properties to load for the file

    Returns
    IFile

    The connected IFile

    GetPageFileAsync(Expression<Func<IFile, Object>>[])

    Gets the file connected to this page

    Declaration
    Task<IFile> GetPageFileAsync(params Expression<Func<IFile, object>>[] expressions)
    Parameters
    Expression<Func<IFile, Object>>[] expressions

    Properties to load for the file

    Returns
    Task<IFile>

    The connected IFile

    GetPageTranslations()

    Returns the page translation status for a given page

    Declaration
    IPageTranslationStatusCollection GetPageTranslations()
    Returns
    IPageTranslationStatusCollection

    IPageTranslationStatusCollection list containing information about this page's translations

    GetPageTranslationsAsync()

    Returns the page translation status for a given page

    Declaration
    Task<IPageTranslationStatusCollection> GetPageTranslationsAsync()
    Returns
    Task<IPageTranslationStatusCollection>

    IPageTranslationStatusCollection list containing information about this page's translations

    GetTemplatesFolder()

    Returns the name of the templates folder, and creates if it doesn't exist.

    Declaration
    string GetTemplatesFolder()
    Returns
    String

    GetTemplatesFolderAsync()

    Returns the name of the templates folder, and creates if it doesn't exist.

    Declaration
    Task<string> GetTemplatesFolderAsync()
    Returns
    Task<String>

    InstantiateDefaultWebPart(DefaultWebPart)

    Instantiates a new web part with default data and returns it

    Declaration
    IPageWebPart InstantiateDefaultWebPart(DefaultWebPart webPart)
    Parameters
    DefaultWebPart webPart

    Default web part to instantiate

    Returns
    IPageWebPart

    Instantiated web part

    InstantiateDefaultWebPartAsync(DefaultWebPart)

    Instantiates a new web part with default data and returns it

    Declaration
    Task<IPageWebPart> InstantiateDefaultWebPartAsync(DefaultWebPart webPart)
    Parameters
    DefaultWebPart webPart

    Default web part to instantiate

    Returns
    Task<IPageWebPart>

    Instantiated web part

    Like()

    Likes a page

    Declaration
    void Like()

    LikeAsync()

    Likes a page

    Declaration
    Task LikeAsync()
    Returns
    Task

    NewTextPart(String)

    Creates a new text part which can be configured and added to the page

    Declaration
    IPageText NewTextPart(string text = null)
    Parameters
    String text

    Optionally provide the text for the text part

    Returns
    IPageText

    The created text part

    NewWebPart(IPageComponent)

    Creates a new web part

    Declaration
    IPageWebPart NewWebPart(IPageComponent clientSideComponent = null)
    Parameters
    IPageComponent clientSideComponent

    The base component to use for this web part

    Returns
    IPageWebPart

    The created web part

    PromoteAsHomePage()

    Sets the current IPage as home page for the current site

    Declaration
    void PromoteAsHomePage()

    PromoteAsHomePageAsync()

    Sets the current IPage as home page for the current site

    Declaration
    Task PromoteAsHomePageAsync()
    Returns
    Task

    PromoteAsNewsArticle()

    Promotes a regular Article client side page as a news page

    Declaration
    void PromoteAsNewsArticle()

    PromoteAsNewsArticleAsync()

    Promotes a regular Article client side page as a news page

    Declaration
    Task PromoteAsNewsArticleAsync()
    Returns
    Task

    Publish(String)

    Publishes a client side page

    Declaration
    void Publish(string comment = null)
    Parameters
    String comment

    Publishing comment

    PublishAsync(String)

    Publishes a client side page

    Declaration
    Task PublishAsync(string comment = null)
    Parameters
    String comment

    Publishing comment

    Returns
    Task

    RemovePageHeader()

    Removes the set page header

    Declaration
    void RemovePageHeader()

    RemoveSchedulePublish()

    Removes the publication schedule of a client side page

    Declaration
    void RemoveSchedulePublish()

    RemoveSchedulePublishAsync()

    Removes the publication schedule of a client side page

    Declaration
    Task RemoveSchedulePublishAsync()
    Returns
    Task

    Save(String)

    Saves the page to the pages library

    Declaration
    string Save(string pageName = null)
    Parameters
    String pageName

    Page name to use

    Returns
    String

    The name of the saved page

    SaveAsTemplate(String)

    Saves the page as a template page

    Declaration
    string SaveAsTemplate(string pageName = null)
    Parameters
    String pageName

    Page name to use

    Returns
    String

    The name of the saved page

    SaveAsTemplateAsync(String)

    Saves the page as a template page

    Declaration
    Task<string> SaveAsTemplateAsync(string pageName = null)
    Parameters
    String pageName

    Page name to use

    Returns
    Task<String>

    The name of the saved page

    SaveAsync(String)

    Saves the page to the pages library

    Declaration
    Task<string> SaveAsync(string pageName = null)
    Parameters
    String pageName

    Page name to use

    Returns
    Task<String>

    The name of the saved page

    SchedulePublish(DateTime)

    Schedules the publication of a client side page

    Declaration
    void SchedulePublish(DateTime publishDate)
    Parameters
    DateTime publishDate

    Date when the page needs to be publishing

    SchedulePublishAsync(DateTime)

    Schedules the publication of a client side page

    Declaration
    Task SchedulePublishAsync(DateTime publishDate)
    Parameters
    DateTime publishDate

    Date when the page needs to be publishing

    Returns
    Task

    SetCustomPageHeader(String, Nullable<Double>, Nullable<Double>)

    Sets page header with custom focal point

    Declaration
    void SetCustomPageHeader(string serverRelativeImageUrl, double? translateX = null, double? translateY = null)
    Parameters
    String serverRelativeImageUrl

    Server relative page header image url

    Nullable<Double> translateX

    X focal point for image

    Nullable<Double> translateY

    Y focal point for image

    SetDefaultPageHeader()

    Sets page header back to the default page header

    Declaration
    void SetDefaultPageHeader()

    TranslatePages()

    Creates page translations for all the languages defined as multi-lingual languages in the site

    Declaration
    IPageTranslationStatusCollection TranslatePages()
    Returns
    IPageTranslationStatusCollection

    IPageTranslationStatusCollection list containing information about this page's translations

    TranslatePages(PageTranslationOptions)

    Creates page translations for the requested languages

    Declaration
    IPageTranslationStatusCollection TranslatePages(PageTranslationOptions pageTranslationOptions)
    Parameters
    PageTranslationOptions pageTranslationOptions

    Options describing the languages in which a translation needs to be created

    Returns
    IPageTranslationStatusCollection

    IPageTranslationStatusCollection list containing information about this page's translations

    TranslatePagesAsync()

    Creates page translations for all the languages defined as multi-lingual languages in the site

    Declaration
    Task<IPageTranslationStatusCollection> TranslatePagesAsync()
    Returns
    Task<IPageTranslationStatusCollection>

    IPageTranslationStatusCollection list containing information about this page's translations

    TranslatePagesAsync(PageTranslationOptions)

    Creates page translations for the requested languages

    Declaration
    Task<IPageTranslationStatusCollection> TranslatePagesAsync(PageTranslationOptions pageTranslationOptions)
    Parameters
    PageTranslationOptions pageTranslationOptions

    Options describing the languages in which a translation needs to be created

    Returns
    Task<IPageTranslationStatusCollection>

    IPageTranslationStatusCollection list containing information about this page's translations

    Unlike()

    Unlikes a page

    Declaration
    void Unlike()

    UnlikeAsync()

    Unlikes a page

    Declaration
    Task UnlikeAsync()
    Returns
    Task

    WebPartIdToDefaultWebPart(String)

    Translated a given web part id to a DefaultWebPart enum. Non default web parts will be returned as ThirdParty

    Declaration
    DefaultWebPart WebPartIdToDefaultWebPart(string id)
    Parameters
    String id

    Web part id to lookup

    Returns
    DefaultWebPart

    Corresponding DefaultWebPart enum value

    Back to top PnP Core SDK
    Generated by DocFX with Material UI
    spacer