Skip to main content

spo page section add

Adds section to modern page

Usage

m365 spo page section add [options]

Options

-n, --pageName <pageName>

Name of the page to add section to.

-u, --webUrl <webUrl>

URL of the site where the page to retrieve is located.

-t, --sectionTemplate <sectionTemplate>

Type of section to add. Allowed values OneColumn, OneColumnFullWidth, TwoColumn, ThreeColumn, TwoColumnLeft, TwoColumnRight, Vertical.

--order [order]

Order of the section to add.

--zoneEmphasis [zoneEmphasis]

Section background shading. Allowed values None, Neutral, Soft, Strong, Image,Gradient

--isLayoutReflowOnTop

The position of the Vertical section for smaller screens. Applied only for Vertical section.

--isCollapsibleSection

Set section to be collapsible.

--showDivider

Shows a divider line between sections.

--iconAlignment [iconAlignment]

Specifies the alignment of the expand/collapse icon. Sets Left alignment if not specified.

--isExpanded

Sets the default display state of the collapsible section. Sets false if not specified.

--gradientText [gradientText]

Sets the gradient setting of the background of a section. Required when zoneEmphasis is Gradient.

--imageUrl [imageUrl]

The background image URL. Required when zoneEmphasis is Image.

--imageHeight [imageHeight]

The height of the background image. Applied only when when zoneEmphasis is Image. Sets 955 value if not specified.

--imageWidth [imageWidth]

The width of the background image. Applied only when zoneEmphasis is Image. Sets 555 value if not specified.

--fillMode [fillMode]

The fill mode of the background image. Applied only when zoneEmphasis is Image. Possible values are ScaleToFill, ScaleToFit, Tile, OriginalSize. Sets ScaleToFill value if not specified.

--useLightText

Specifies whether to use light text for the background. Applied only when zoneEmphasis is Image.

--overlayColor [overlayColor]

The overlay color for the background in #RRGGBB format. Applied only when zoneEmphasis is Image or Gradient. Sets #ffffff value if not specified.

--overlayOpacity [overlayOpacity]

The overlay opacity for the background. Applied only when zoneEmphasis is Image or Gradient. Sets 60 value if not specified.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

If the specified pageName doesn't refer to an existing modern page, you will get a File doesn't exists error.

Examples

Add section to the modern page

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate OneColumn --order 1

Add section with background shading to the modern page

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate OneColumn --zoneEmphasis Strong 

Add a vertical section to the modern page. There can only be one vertical section per page. If a vertical section already exists on the page, the command will not have any effect.

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate Vertical

Add Vertical section with background shading to the modern page with adjusting the position of this section for smaller screens to the top

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate Vertical --zoneEmphasis Neutral --isLayoutReflowOnTop

Add OneColumn section as a collapsible section as expanded with icon alligned to the left

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate OneColumn --isCollapsibleSection --isExpanded --iconAlignment Left

Add TwoColumn section with Image background

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate TwoColumn --imageUrl "https://contoso.com/image.jpg" --zoneEmphasis Image --fillMode Tile

Add OneColumn section with Gradient background

m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate TwoColumn --zoneEmphasis Gradient --gradientText "linear-gradient(72.44deg, #E6FBFE 0%, #EDDDFB 100%)"

Response

The command won't return a response on success.

CTRL + M