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,Flexible.--order [order]Order of the section to add.
--zoneEmphasis [zoneEmphasis]Section background shading. Allowed values
None,Neutral,Soft,Strong,Image,Gradient--isLayoutReflowOnTopThe position of the Vertical section for smaller screens. Applied only for
Verticalsection.--isCollapsibleSectionSet section to be collapsible.
--showDividerShows a divider line between sections.
--iconAlignment [iconAlignment]Specifies the alignment of the expand/collapse icon. Sets
Leftalignment if not specified.--isExpandedSets the default display state of the collapsible section. Sets
falseif not specified.--headingLevel [headingLevel]Heading level of collapsible section Allowed values
2,3,4.--gradientText [gradientText]Sets the gradient setting of the background of a section. Required when
zoneEmphasisisGradient.--imageUrl [imageUrl]The background image URL. Required when
zoneEmphasisisImage.--imageHeight [imageHeight]The height of the background image. Applied only when when
zoneEmphasisisImage. Sets955value if not specified.--imageWidth [imageWidth]The width of the background image. Applied only when
zoneEmphasisisImage. Sets555value if not specified.--fillMode [fillMode]The fill mode of the background image. Applied only when
zoneEmphasisisImage. Possible values areScaleToFill,ScaleToFit,Tile,OriginalSize. SetsScaleToFillvalue if not specified.--useLightTextSpecifies whether to use light text for the background. Applied only when
zoneEmphasisisImage.--overlayColor [overlayColor]The overlay color for the background in #RRGGBB format. Applied only when
zoneEmphasisisImageorGradient. Sets#ffffffvalue if not specified.--overlayOpacity [overlayOpacity]The overlay opacity for the background. Applied only when
zoneEmphasisisImageorGradient. Sets60value if not specified.--collapsibleTitle [collapsibleTitle]The display name of the collapsible section.
--zoneReflowStrategy [zoneReflowStrategy]Mobile and email reflow. Allowed values
TopToBottom,LeftToRight. Applied only forFlexiblesection.--zoneHeight [zoneHeight]Section height. Minimum value is
34. Applied only forFlexiblesection.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns 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 One Column section as a collapsible section with title
m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate OneColumn --isCollapsibleSection --collapsibleTitle "Collapsible Section Title"
Add OneColumn section as a collapsible section as expanded with icon aligned 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 OneColumn section as a collapsible section as expanded with headingLevel 3
m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate OneColumn --isCollapsibleSection --isExpanded --headingLevel 3
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%)"
Add a Flexible section to the modern page with mobile and email reflow and section height.
m365 spo page section add --pageName home.aspx --webUrl https://contoso.sharepoint.com/sites/newsletter --sectionTemplate Flexible --zoneHeight 100 --zoneReflowStrategy LeftToRight
Response
The command won't return a response on success.