Add-PnPPageSection
SYNOPSIS
Adds a new section to a page.
SYNTAX
Add-PnPPageSection [-Page] <PagePipeBind> -SectionTemplate <CanvasSectionTemplate>
[-Order <Int32>] [-ZoneEmphasis <Int32>] [-VerticalZoneEmphasis <Int32>]
[-ZoneReflowStrategy <ZoneReflowStrategy>] [-Collapsible] [-DisplayName <String>] [-IsExpanded]
[-Connection <PnPConnection>]
DESCRIPTION
Allows to add a new section to a page.
EXAMPLES
EXAMPLE 1
Add-PnPPageSection -Page "MyPage" -SectionTemplate OneColumn
Adds a new one-column section to the page 'MyPage'
EXAMPLE 2
Add-PnPPageSection -Page "MyPage" -SectionTemplate ThreeColumn -Order 10
Adds a new Three columns section to the page 'MyPage' with an order index of 10.
EXAMPLE 3
$page = Add-PnPPage -Name "MyPage"
Add-PnPPageSection -Page $page -SectionTemplate OneColumn
Adds a new one column section to the page 'MyPage'.
EXAMPLE 4
$page = Add-PnPPage -Name "MyPage"
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 5
$page = Add-PnPPage -Name "MyPage"
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.
EXAMPLE 6
$page = Add-PnPPage -Name "MyPage"
Add-PnPPageSection -Page $page -SectionTemplate FlexibleLayoutSection -Order 1 -ZoneReflowStrategy LeftToRight
Adds a flexible layout section to the page 'MyPage' and sets the zone reflow strategy to LeftToRight. Note: -ZoneReflowStrategy only applies to flexible layout section templates (for example FlexibleLayoutSection and FlexibleLayoutVerticalSection).
EXAMPLE 7
$page = Add-PnPPage -Name "MyPage"
Add-PnPPageSection -Page $page -SectionTemplate TwoColumn -Order 1 -Collapsible -DisplayName "My Collapsible Section" -IsExpanded
Adds a collapsible section to the page 'MyPage', sets its display name, and creates it expanded.
PARAMETERS
-Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: PnPConnection
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Collapsible
Makes the new section collapsible.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DisplayName
Sets the display name of a collapsible section. Use together with -Collapsible.
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Order
Sets the order of the section. (Default = 1)
Type: Int32
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Page
The name of the page or the page object.
Type: PagePipeBind
Parameter Sets: (All)
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-SectionTemplate
Specifies the columns template to use for the section.
Type: CanvasSectionTemplate
Parameter Sets: (All)
Accepted values: OneColumn, OneColumnFullWidth, TwoColumn, ThreeColumn, TwoColumnLeft, TwoColumnRight, OneColumnVerticalSection, TwoColumnVerticalSection, ThreeColumnVerticalSection, TwoColumnLeftVerticalSection, TwoColumnRightVerticalSection, FlexibleLayoutSection, FlexibleLayoutVerticalSection
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IsExpanded
Creates the collapsible section in expanded state. Use together with -Collapsible. If omitted, the section is created collapsed.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-ZoneEmphasis
Sets the background of the section (default = 0).
Type: Int32
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-VerticalZoneEmphasis
Sets the background of the vertical section (default = 0). Works only for vertical column layouts, will be ignored for other layouts.
Type: Int32
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ZoneReflowStrategy
Controls how zones are reflowed when rendering flexible layout sections. This parameter only applies to flexible layout section templates (for example FlexibleLayoutSection and FlexibleLayoutVerticalSection). If not provided, the default is TopToDown.
Type: ZoneReflowStrategy
Parameter Sets: (All)
Accepted values: TopToDown, LeftToRight
Required: False
Position: Named
Default value: TopToDown
Accept pipeline input: False
Accept wildcard characters: False