Skip to main content

Posts

Showing posts from June, 2019

Detecting SharePoint environment from an SPFX.

Detecting SharePoint environment from an SPFX. SPFX web parts can be added to modern and classic SharePoint pages and we might need to load different resources depending of the environment type. The environment type can be detected using the EnvironmentType enumeration, directly from your SPFX code. Member Description ClasicSharePoint Indicates that the framework was loaded from a classic SharePoint page Local Indicates that the framework was loaded from the workbench SharePoint Indicates that the framework was loaded by a client-rendered SharePoint page Test Represents the scenario of the framework hosted in a unit/integration test To detect the environment type start by importing the enumeration from the sp-core-library: import { Environment, EnvironmentType} from '@microsoft/sp-core-library'; Use the code below to target...

Modern SharePoint site creation with REST API.

The following REST commands are available for creating a modern SharePoint Communication site: Create . Create a new SharePoint site. Delete . Deletes a SharePoint site. Status . Get the status of a SharePoint site. The base URL for the REST commands is  _api/SPSiteManager . Create a modern site Using the following REST api you can create both Communication sites and non-group associated Team Sites. To specify which type of site to create you use the WebTemplate attribute. Use one of the following templates to select which type of site to create: Communication Site:  SITEPAGEPUBLISHING#0 non-group associated Team Site:  STS#3 JSON url: /_api/SPSiteManager/create accept: application/json;odata.metadata=none odata-version: 4.0 method: POST body: { "Title" : "Communication Site 1" , "Url" : "https://contoso.sharepoint.com/sites/commsite1" , "Lcid" : 1033 , "ShareByEmailEnabled" : false , ...

Deploying SharePoint Server Hybrid MS-301 Completed.

Deploying SharePoint Server Hybrid MS-301  Completed.