From ae33c7906e30b28d435014937311327140e5e1bb Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Mon, 22 May 2023 22:03:27 +0300 Subject: [PATCH] Feature #2350 - Add support for vertical column emphasis --- CHANGELOG.md | 3 ++- documentation/Add-PnPPageSection.md | 28 +++++++++++++++++++++++++--- src/Commands/Pages/AddPageSection.cs | 5 ++++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cab8990e4..9982e083e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `-BlockDownloadPolicy`, `-ExcludeBlockDownloadPolicySiteOwners` and `ExcludedBlockDownloadGroupIds` parameters to `Set-PnPTenantSite` and `Set-PnPSite` cmdlets. [#3084](https://github.com/pnp/powershell/pull/3084) - Added `-ArchiveRedirectUrl` to `Set-PnPTenant` allowing the configuration of a custom page to be shown when navigating to an archived SharePoint Online site [#3100](https://github.com/pnp/powershell/pull/3100) - Added `-BlockSendLabelMismatchEmail` to `Set-PnPTenant` allowing the warning e-mail being sent when uploading a file with a higher sensitivity label than the site it is being uploaded to to be disabled. [#3113](https://github.com/pnp/powershell/pull/3113) -- Added `Move-PnPTerm` and `Move-PnPTermSet` cmdlets to allow moving the terms and termsets. [#2989](https://github.com/pnp/powershell/pull/2989) +- Added `Move-PnPTerm` and `Move-PnPTermSet` cmdlets to allow moving the terms and termsets. [#2989](https://github.com/pnp/powershell/pull/2989) +- Added `-VerticalZoneEmphasis` parameter to `Add-PnPPageSection` cmdlet to allow setting the emphasis value for vertical columns. ### Fixed diff --git a/documentation/Add-PnPPageSection.md b/documentation/Add-PnPPageSection.md index d45154896..c34e1e6e2 100644 --- a/documentation/Add-PnPPageSection.md +++ b/documentation/Add-PnPPageSection.md @@ -16,7 +16,7 @@ Adds a new section to a page ```powershell Add-PnPPageSection [-Page] -SectionTemplate - [-Order ] [-ZoneEmphasis ] [-Connection ] + [-Order ] [-ZoneEmphasis ] [-VerticalZoneEmphasis ] [-Connection ] ``` @@ -56,6 +56,15 @@ PS> Add-PnPPageSection -Page $page -SectionTemplate OneColumn -ZoneEmphasis 2 Adds a new one column section to the page 'MyPage' and sets the background to 2 (0 is no background, 3 is highest emphasis) +### EXAMPLE 4 +```powershell +$page = Add-PnPPage -Name "MyPage" +PS> Add-PnPPageSection -Page $page -SectionTemplate OneColumnVerticalSection -Order 1 -ZoneEmphasis 2 -VerticalZoneEmphasis 3 +``` + +Adds a new one column with one vertical section to the page 'MyPage' and sets the zone emphasis to 2 for one column and vertical zone emphasis to 3 for the vertical column. + + ## PARAMETERS ### -Connection @@ -131,8 +140,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` -## RELATED LINKS +### -VerticalZoneEmphasis +Sets the background of the vertical section (default = 0). +Works only for vertical column layouts, will be ignored for other layouts. -[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) +```yaml +Type: Int32 +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` +## RELATED LINKS +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) diff --git a/src/Commands/Pages/AddPageSection.cs b/src/Commands/Pages/AddPageSection.cs index 7be050ce9..6a34037ee 100644 --- a/src/Commands/Pages/AddPageSection.cs +++ b/src/Commands/Pages/AddPageSection.cs @@ -20,13 +20,16 @@ public class AddPageSection : PnPWebCmdlet [Parameter(Mandatory = false)] public int ZoneEmphasis = 0; + [Parameter(Mandatory = false)] + public int VerticalZoneEmphasis = 0; + protected override void ExecuteCmdlet() { var page = Page?.GetPage(Connection); if (page != null) { - page.AddSection(SectionTemplate, Order, ZoneEmphasis); + page.AddSection(SectionTemplate, Order, ZoneEmphasis, VerticalZoneEmphasis); page.Save(); } else