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

update fork #11

Merged
merged 3 commits into from
May 6, 2019
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [3.10.1906.0 - June 2019 Release]

### Added

### Changed

### Deprecated

### Contributors

## [3.9.1905.0 - May 2019 Release]

### Added

- Added Template as a possible PromoteAs value for a Add-PnPClientSidePage and Set-PnPClientSidePage
- Added -HeaderLayout and -HeaderEmphasis parameters to Set-PnPWeb
- Support to specify lcid for Export-PnPTaxonomy for a particular termset
- Added support in the Navigation cmdlets to manage the site footer on modern sites.
Expand Down
15 changes: 13 additions & 2 deletions Commands/ClientSidePages/AddClientSidePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ namespace SharePointPnP.PowerShell.Commands.ClientSidePages
Code = @"PS:> Add-PnPClientSidePage -Name ""NewPage"" -ContentType ""MyPageContentType""",
Remarks = "Creates a new Client-Side page named 'NewPage' and sets the content type to the content type specified",
SortOrder = 2)]
[CmdletExample(
Code = @"PS:> Add-PnPClientSidePage -Name ""NewPageTemplate"" -PromoteAs Template",
Remarks = "Creates a new Client-Side page named 'NewPage' and saves as a template to the site.",
SortOrder = 2)]
public class AddClientSidePage : PnPWebCmdlet
{
[Parameter(Mandatory = true, Position = 0, HelpMessage = "Specifies the name of the page.")]
Expand Down Expand Up @@ -68,9 +72,16 @@ protected override void ExecuteCmdlet()
// Create a page that persists immediately
clientSidePage = SelectedWeb.AddClientSidePage(name);
clientSidePage.LayoutType = LayoutType;
clientSidePage.Save(name);
if (PromoteAs == ClientSidePagePromoteType.Template)
{
clientSidePage.SaveAsTemplate(name);
}
else
{
clientSidePage.Save(name);
}

if(MyInvocation.BoundParameters.ContainsKey("ContentType"))
if (MyInvocation.BoundParameters.ContainsKey("ContentType"))
{
ContentType ct = null;
if (ContentType.ContentType == null)
Expand Down
6 changes: 5 additions & 1 deletion Commands/ClientSidePages/GetClientSidePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ namespace SharePointPnP.PowerShell.Commands.ClientSidePages
[CmdletExample(
Code = @"PS:> Get-PnPClientSidePage -Identity ""MyPage.aspx""",
Remarks = "Gets the Modern Page (Client-Side) named 'MyPage.aspx' in the current SharePoint site",
SortOrder = 2)]
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Get-PnPClientSidePage ""MyPage""",
Remarks = "Gets the Modern Page (Client-Side) named 'MyPage.aspx' in the current SharePoint site",
SortOrder = 2)]
[CmdletExample(
Code = @"PS:> Get-PnPClientSidePage ""Templates/MyPageTemplate""",
Remarks = "Gets the Modern Page (Client-Side) named 'MyPageTemplate.aspx' from the templates folder of the Page Library in the current SharePoint site",
SortOrder = 3)]
public class GetClientSidePage : PnPWebCmdlet
{
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0, HelpMessage = "The name of the page")]
Expand Down
6 changes: 5 additions & 1 deletion Commands/ClientSidePages/RemoveClientSidePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ namespace SharePointPnP.PowerShell.Commands.ClientSidePages
Code = @"PS:> Remove-PnPClientSidePage -Identity ""MyPage""",
Remarks = "Removes the Client-Side page named 'MyPage.aspx'",
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Remove-PnPClientSidePage -Identity ""Templates/MyPageTemplate""",
Remarks = "Removes the specified Client-Side page which is located in the Templates folder of the Site Pages library.",
SortOrder = 2)]
[CmdletExample(
Code = @"PS:> Remove-PnPClientSidePage $page",
Remarks = "Removes the specified Client-Side page which is contained in the $page variable.",
SortOrder = 2)]
SortOrder = 3)]
public class RemoveClientSidePage : PnPWebCmdlet
{
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0, HelpMessage = "The name of the page")]
Expand Down
8 changes: 7 additions & 1 deletion Commands/ClientSidePages/SetClientSidePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ protected override void ExecuteCmdlet()
}
}

clientSidePage.Save(name);
if (PromoteAs == ClientSidePagePromoteType.Template)
{
clientSidePage.SaveAsTemplate(name);
} else
{
clientSidePage.Save(name);
}

// If a specific promote type is specified, promote the page as Home or Article or ...
switch (PromoteAs)
Expand Down
1 change: 1 addition & 0 deletions Commands/Enums/ClientSidePagePromoteType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public enum ClientSidePagePromoteType
None = 0,
HomePage = 1,
NewsArticle = 2,
Template = 3
}
}
#endif