pnp / pnp/powershell

[FEATURE] Support Banner WebPart

Open
#4,383 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Is your feature request related to a problem? Please describe.
Unable to add the Banner WebPart via the CLI.

Describe the solution you'd like
Support for Banner WebPart in Add-PnPPageWebPart.

A Banner component can be created via the Sharepoint Online GUI. The following values exist

JsonWebPartData          : {"id":"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788","instanceId":"00000000-0000-0000-0000-000000000000","title":"Banner","description":"Banner mit Titel- und Autoreninformationen
                           anzeigen","dataVersion":"1.5","properties":{"title":"Banner Title here","imageSourceType":4,"layou
                           tType":"FullWidthImage","textAlignment":"Left","showTopicHeader":false,"showPublishDate":fal
                           se,"topicHeader":"","authorByline":[],"authors":[],"isFullWidth":true,"enableGradientEffect"
                           :true,"isDecorative":true},"dynamicDataPaths":{},"dynamicDataValues":{},"serverProcessedCont
                           ent":{"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{},"links":{}}}
HtmlPropertiesData       :
HtmlProperties           :
WebPartId                : cbe7b0a9-3504-44dd-a3a3-0e5cacd07788
SupportsFullBleed        : True
WebPartData              :
Title                    : Banner
Description              : Banner mit Titel- und Autoreninformationen anzeigen
WebPartPreviewImage      :
PropertiesJson           : {"title":"Banner Titlte here","imageSourceType":4,"layoutType":"FullWidthImage","textAlignment":"Le
                           ft","showTopicHeader":false,"showPublishDate":false,"topicHeader":"Subline here","authorByline":[],"auth
                           ors":[],"isFullWidth":true,"enableGradientEffect":true,"isDecorative":true}
Properties               : {"title":"Banner Titlte here","imageSourceType":4,"layoutType":"FullWidthImage","textAlignment":"Le
                           ft","showTopicHeader":false,"showPublishDate":false,"topicHeader":"Subline here","authorByline":[],"auth
                           ors":[],"isFullWidth":true,"enableGradientEffect":true,"isDecorative":true}
ServerProcessedContent   : {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{},"links":{}}
DynamicDataPaths         : {}
DynamicDataValues        : {}
Type                     : PnP.Core.Model.SharePoint.PageWebPart
SpControlData            : PnP.Core.Model.SharePoint.WebPartControlData
IsHeaderControl          : False
RichTextEditorInstanceId :
Section                  : PnP.Core.Model.SharePoint.CanvasSection
Column                   : PnP.Core.Model.SharePoint.CanvasColumn
DataVersion              : 1.5
CanvasDataVersion        : 1.0
CanvasControlData        :
ControlType              : 3
JsonControlData          : {"webPartId":"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788","rteInstanceId":null,"addedFromPersisted
                           Data":true,"reservedHeight":228,"reservedWidth":711,"controlType":3,"id":"4874a93d-036e-4d85
                           -a482-1205f0510f3e","position":{"controlIndex":1,"zoneIndex":1,"sectionIndex":1,"sectionFact
                           or":8,"layoutIndex":1},"emphasis":{"zoneEmphasis":0},"zoneGroupMetadata":null}
InstanceId               : 00000000-0000-0000-0000-000000000000
Order                    : 1

Describe alternatives you've considered
Using the hero component does not result in the same component being added to the page.

Additional context
Bildschirmfoto 2024-10-04 um 19 34 58

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Add-PnPPageWebPart and its -DefaultWebPartType handling. Compare the Banner WebPart identifier and properties in the supplied JsonWebPartData with the existing supported web-part types. Done means the CLI accepts Banner and creates the corresponding SharePoint page web part, rather than requiring the Hero component.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.