In this article, I would like to explain this: If the user makes any changes to duplicate page, how to publish the duplicate client side pages to the original page into same site pages library within the same site collection.
As a developer, we have a couple of options to duplicate the page into another modern site collection library or different folder structure, but there is no way to copy the pages within the same modern site collection sites library within the same folder structure.
Prerequisite Steps
Let's create a page and add existing below control, or user can add any other available controls. This is just for demo purposes.
write-host -ForegroundColor Magenta "Page reverted with name of " $targetpage
}
catch {
Write-Host - ForegroundColor Red 'Error ', ':'
$Error[0].ToString();
}
Save and run this script.
OutPut Steps
Applying template to client side pages
Export-PnPClientSidePage Cmdlets applying the PnP Provisioning template and export ".xml" file into shared locaiton. Cmdlets referece can be find here
Creation of client side pages
Apply-PnPProvisioningTemplate cmdlets will create a new page within the same library from download or exported ".xml" file with provided name i.e. pagename _ duplicate
In this article, I would like to explain how to duplicate client side pages which have OOTB webparts and custom SPFx webparts into the same site pages library within the same site collection.
As a developer, we have a couple of options to duplicate the page into another modern site collection library or different folder structure, but there is no way to copy the pages within the same modern site collection site library within the same folder structure.
Prerequisites Steps
Let's create a page and add the exisitng below controls, or the user can add any other available controls. This is just for demo purposes.
write-host -ForegroundColor Magenta "Page Created with name of " $targetpage
}
catch {
Write-Host - ForegroundColor Red 'Error ', ':'
$Error[0].ToString();
Save and run this script.
OutPut Steps
Applying template to client side pages
Export-PnPClientSidePage Cmdlets applying the PnP Provisioning template and export ".xml" file into shared locaiton. Cmdlets referece can be found here
Creation of client side pages
Apply-PnPProvisioningTemplate cmdlets will create a new page within same library from download or exported ".xml" file with provided name i.e. pagename _ duplicate
Implement SPFx (SharePoint Framework) deployment with DevOps using SharePoint ALM Commands & Blob Storage
Azure DevOps (Visual Studio Team Services / Team Foundation Server) consists of a set of tools and services that help developers implement DevOps, Continuous Integration, and Continuous Deployment processes for their development projects.
This article explains the steps involved in setting up your Azure DevOps environment with Continuous Integration and Continuous Deployment to automate your SharePoint Framework builds, unit tests, and deployment.
SharePoint ALM (Application Life Cycle Management) APIs provide simple APIs to manage deployment of your SharePoint Framework solutions and add-ins across your tenant or Site Collection level.
ALM APIs can be used to perform exactly the same operations that are available from a UI perspective
Continuous Integration
Continuous Integration (CI) helps developers integrate code into a shared repository by automatically build and packaging the solution each time new code changes are submitted.
Setting up Azure DevOps for Continuous Integration with a SharePoint Framework solution requires the following steps:
Office Azure & SharePoint ALM - Build Pipeline
Node 10.x
Gulp Clean
Gulp Build
Gulp Bundle --ship
Gulp Package-Solution --ship
Publish Build Artifacts (Task Version 1)
"Display Name" -> Publish Artifact: CDN
"Path to Publish" -> temp/deploy
"Artifact Name" -> CDN
"Artifact Publish Location" -> Azure Pipeline
Publish Build Artifact
"Display Name" -> Publish Artifact: App
"Path to Publish" -> sharepoint/solution
"Artifact Name" -> App
"Artifact Publish Location" -> Azure Pipeline
Continuous Deployment
Continuous Deployment (CD) takes validated code packages from build process and deploys them into a staging or production environment. Developers can track which deployments were successful or not and narrow down issues to specific package versions.
Setting up Azure DevOps for Continuous Deployments with a SharePoint Framework solution requires the following steps:
Implement SPFx (SharePoint Framework) deployment with Azure DevOps Pipeline using Office 365 CLI
Azure DevOps (Visual Studio Team Services / Team Foundation Server) consists of a set of tools and services that help developers implement DevOps, Continuous Integration, and Continuous Deployment processes for their development projects.
This article explains the steps involved in setting up your Azure DevOps environment with Continuous Integration and Continuous Deployment to automate your SharePoint Framework builds, unit tests, and deployment.
Continuous Integration
Continuous Integration (CI) helps developers integrate code into a shared repository by automatically build and packaging the solution each time new code changes are submitted.
Setting up Azure DevOps for Continuous Integration with a SharePoint Framework solution requires the following steps:
Office 365 CLI Build Definition
Node 10.x
Gulp Clean
Gulp Build
Gulp Bundle --ship
Gulp Package-Solution --ship
Copy Files
"Display Name" -> Copy Files To: Copy Files to: $(Build.ArtifactStagingDirectory)/drop
"Publish To Path" -> $(Build.ArtifactStagingDirectory)
"Artifact Name" -> Drop
"Artifact Publish Location" -> Azure Pipelines
Continuous Deployment
Continuous Deployment (CD) takes validated code packages from build process and deploys them into a staging or production environment. Developers can track which deployments were successful or not and narrow down issues to specific package versions.
Setting up Azure DevOps for Continuous Deployments with a SharePoint Framework solution requires the following steps:
Office 365 CLI Release Pipeline
Node 10.x
NPM
"Display Name" -> npm custom
"Command" -> custom
"command and arguments" -> install -g @pnp/office365-cli
Adaptive Cards are platform-agnostic snippets of UI, authored in JSON, that apps and services can openly exchange. When delivered to a specific app, the JSON is transformed into native UI that automatically adapts to its surroundings. It helps design and integrate light-weight UI for all major platforms and frameworks.
Adaptive Cards Templating is a revolutionary change. It enables the separation of Data & Layouts.
Let's understand the Adaptive Cards online designer. The designer contains multiple panels that serve different purposes, as shown in the following image:
Card Elements List of all elements available for use within Adaptive Cards
Rendered Card Preview rendering of the card as it would appear in the currently selected host app.
Card Payload Editor The browser-friendly JSON editor contains the source of the Adaptive Card that's rendered in the Rendered Card pane.
Card Structure The card is represented in this panel as a hierarchical structure. Notice that as you select elements in this panel, the corresponding control is highlighted in the Rendered Card pane.
Element Properties The properties, including those that aren't specified in the source of the Adaptive Card, are displayed in this panel for the control currently selected in the Card Structure panel.
Sample Data Editor This panel contains the JSON used when using the templating capability of Adaptive Cards.
Templating enables the separation of data from layout in your Adaptive Card. The template language is the syntax used to author a template
Binding syntax changed from {...} to ${...} i.e. “text": "Hello {name}" becomes "text": "Hello ${name}"
Static Card Payload
{
"type": "TextBlock",
"text": "Manoj Mittal"
}
Template Payload
{
"type": "TextBlock",
"text": "${UserName}"
}
Let's create bot framework sdkv4 project and associate it with adaptive card templating.
Step 1 - Build Bot Framework SDKV4 C# Project
Prerequisties - Azure Bot Framework template installed with Visual Studio 2019.
Launch Visual Studio 2019
Select Create new project
Select Azure Bot Framework (.Net Core 2.1 or 3.1)
Create Project.
Step 2 - Create Adaptive Card Template
Login to https://adaptivecards.io/designer/
Card Element Section desing your card with placehoder, which will be used to bind the data at client side.
On Message Activity Function, Load Json into template variable
var adaptiveCardJson = (File.ReadAllText(_cards));
AdaptiveCardTemplate template = new AdaptiveCardTemplate(adaptiveCardJson);
Step 4 - Add Data and bind with template variable
Add reference of AdaptiveCards.Templating.
Note
I used static data or hard coded data here for article purposes. Data Json can be rendered via API also.
var adaptiveCardJson = (File.ReadAllText(_cards));
AdaptiveCardTemplate template = new AdaptiveCardTemplate(adaptiveCardJson);
var myData = new
{
id = "1",
name = "Saturn",
summary = "Saturn is the sixth planet from the Sun and the second-largest in the Solar System, after Jupiter. It is a gas giant with an average radius about nine times that of Earth. It has only one-eighth the average density of Earth; however, with its larger volume, Saturn is over 95 times more massive. Saturn is named after the Roman god of wealth and agriculture; its astronomical symbol (♄) represents the god's sickle.",
Step 5 - Run Code locally (F5) using Bot Framework Emulator
Data and Layout separated while rendering card. Layouts exists at client side and binding of data also happens at client side. As data will come from the API, it will have server side execution.
Earlier we used to bind the Data and Layout at server side and traverse the entire structure.