Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #2350 - Add support for vertical column emphasis #3129

Merged
merged 3 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `-OpenInNewTab` parameter to `Add-PnPNavigationNode` cmdlet to allow links to be opened in a new tab. [#3094](https://github.com/pnp/powershell/pull/3094)
- 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

Expand Down
28 changes: 25 additions & 3 deletions documentation/Add-PnPPageSection.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Adds a new section to a page

```powershell
Add-PnPPageSection [-Page] <PagePipeBind> -SectionTemplate <CanvasSectionTemplate>
[-Order <Int32>] [-ZoneEmphasis <Int32>] [-Connection <PnPConnection>]
[-Order <Int32>] [-ZoneEmphasis <Int32>] [-VerticalZoneEmphasis <Int32>] [-Connection <PnPConnection>]

```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
5 changes: 4 additions & 1 deletion src/Commands/Pages/AddPageSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down