Variations in the SharePoint Add-in model
The approach you take to configure variations is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, the SharePoint Server-side Object Model (Microsoft.SharePoint.Publishing.Variations) was used to configure variations, and features that executed the code were deployed via SharePoint Solutions.
In an SharePoint Add-in model scenario, you use the SharePoint Client-side Object Model (CSOM) or REST API to configure variations. This pattern is commonly referred to as the remote provisioning pattern.
As a rule of a thumb, we would like to provide the following high-level guidelines to configure variations in the new SharePoint Add-in model.
- Use the SharePoint Client-side Object Model (CSOM) API to configure variations whenever possible.
- Not all variation configuration settings are currently available via the SharePoint CSOM API Variations classes listed above.
- You can go beyond what the CSOM API Variations classes listed above provide and configure some variations settings. To do this, you set the values for variations settings stored in site property bags and/or modify list items in the lists associated with variations.
- The VariationsExtensions.cs class (O365 PnP Sample) contains several examples that modify property bag and list item values to configure variations settings.
- The VariationsExtensions.cs class (O365 PnP Sample) illustrates how to configure all of the settings that you can set in the variations settings page.
- The Turn on variations settings so you can create variations of your site (O365 Support Article) lists the items you can configure in the variations settings page and describes what they do.
- Guidance articles at http://aka.ms/OfficeDevPnPGuidance
- References in MSDN at http://aka.ms/OfficeDevPnPMSDN
- Videos at http://aka.ms/OfficeDevPnPVideos
Related PnP samples
- Office 365 Multi Tenant (MT)
- Office 365 Dedicated (D)
- SharePoint 2013 on-premises