Table of Contents

Interface IPageWebPart

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

This class is used to instantiate modern web parts. Using this class you can instantiate a control and add it on a IPage.

public interface IPageWebPart : ICanvasControl
Inherited Members

Properties

Description

Description of the web part

string Description { get; set; }

Property Value

string

DynamicDataPaths

DynamicDataPaths json node

JsonElement DynamicDataPaths { get; }

Property Value

JsonElement

DynamicDataValues

DynamicDataValues json node

JsonElement DynamicDataValues { get; }

Property Value

JsonElement

FlexibleLayoutPosition

Flexible layout position of the control

ControlFlexLayoutPosition FlexibleLayoutPosition { get; set; }

Property Value

ControlFlexLayoutPosition

HtmlProperties

Value of the "data-sp-htmlproperties" attribute

string HtmlProperties { get; }

Property Value

string

HtmlPropertiesData

Value of the "data-sp-htmlproperties" element

string HtmlPropertiesData { get; }

Property Value

string

IsHeaderControl

This control lives in the page header (not removable control)

bool IsHeaderControl { get; set; }

Property Value

bool

JsonWebPartData

Value of the "data-sp-webpartdata" attribute

string JsonWebPartData { get; }

Property Value

string

Properties

Web properties as configurable JsonElement

JsonElement Properties { get; }

Property Value

JsonElement

PropertiesJson

Json serialized web part information. For 1st party web parts this ideally is the full JSON string fetch via workbench or via copying it from an existing page. It's important that the serverProcessedContent element is included here!

string PropertiesJson { get; set; }

Property Value

string

RichTextEditorInstanceId

If this webpart is used inline in a text editor then this property points to the editor using it

string RichTextEditorInstanceId { get; set; }

Property Value

string

ServerProcessedContent

ServerProcessedContent json node

JsonElement ServerProcessedContent { get; }

Property Value

JsonElement

SupportsFullBleed

Supports full bleed display experience

bool SupportsFullBleed { get; }

Property Value

bool

Title

Title of the web part

string Title { get; set; }

Property Value

string

Type

Return Type of the client side web part

Type Type { get; }

Property Value

Type

WebPartData

Value of the "data-sp-webpart" attribute

string WebPartData { get; }

Property Value

string

WebPartId

ID of the client side web part

string WebPartId { get; }

Property Value

string

WebPartPreviewImage

Preview image that can serve as page preview image when the page holding this web part is promoted to a news page

string WebPartPreviewImage { get; }

Property Value

string

Methods

BuildControlData(float)

Builds Control attributes based on current settings, also used by pnpframework

void BuildControlData(float controlIndex)

Parameters

controlIndex float