### Install OpenID Connect Add-on Source: https://docs.developers.optimizely.com/content-management-system/docs/paas-cms-core-openid Install the EPiServer.OpenIDConnect addon using the .NET CLI. ```shell dotnet add EPiServer.OpenIDConnect ``` -------------------------------- ### Install CMS Sample Site with Alloy Templates Source: https://docs.developers.optimizely.com/content-management-system/docs/install-a-sample-site Installs a CMS sample site pre-configured with Alloy templates. ```bash dotnet new epi-alloy-mvc ``` -------------------------------- ### Set Installation Mode to UI Source: https://docs.developers.optimizely.com/content-management-system/docs/installing-add-ons Configure the installation mode to 'UI' to enable app installations through the Optimizely user interface. This setting is part of the episerver.packaging configuration. ```xml ``` -------------------------------- ### Install the .NET Upgrade Assistant Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Installs the Upgrade assistant as a global .NET CLI tool. This is the standard method for installing the tool. ```shell dotnet tool install -g upgrade-assistant ``` -------------------------------- ### Set Installation Mode to Code Source: https://docs.developers.optimizely.com/content-management-system/docs/installing-add-ons Configure the installation mode to 'Code' in the episerver.packaging section of the configuration file. This is a prerequisite for installing add-ons via Visual Studio. ```xml ``` -------------------------------- ### Install EPiServer.Commerce.Core NuGet Package Source: https://docs.developers.optimizely.com/content-management-system/docs/dibs Install the EPiServer.Commerce.Core NuGet package using the Package Manager Console. Ensure you install the correct version matching your site's Optimizely Commerce Connect installation and avoid database transforms. ```powershell Install-Package EPiServer.Commerce.Core ``` -------------------------------- ### Install Required NuGet Packages Source: https://docs.developers.optimizely.com/content-management-system/docs/cmp-dam-in-cms Install the essential NuGet packages for the Optimizely CMS Welcome Integration and CMP Client. Recommended for production deployments. ```bash dotnet add package EPiServer.CMS.WelcomeIntegration.UI dotnet add package EPiServer.Cms.WelcomeIntegration.Core dotnet add package Optimizely.Cmp.Client # Recommended for production deployments dotnet add package EPiServer.Cms.WelcomeIntegration.Graph ``` -------------------------------- ### Troubleshoot Upgrade Assistant Installation Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Attempts to install the Upgrade assistant while ignoring failed NuGet sources. This can help resolve installation issues caused by invalid or authenticated sources in your NuGet configuration. ```shell dotnet tool install -g upgrade-assistant --ignore-failed-sources ``` -------------------------------- ### Install Empty Commerce Connect Site Source: https://docs.developers.optimizely.com/content-management-system/docs/install-a-sample-site Use this command to create a new, empty Optimizely Commerce Connect site. ```bash dotnet new epi-commerce-empty ``` -------------------------------- ### Install and Run .NET Upgrade Assistant Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-to-cms-12 Installs the global .NET Upgrade Assistant tool and then runs it against a specified project file. This tool helps convert .NET 4 codebases to ASP.NET Core. ```bash dotnet tool install -g upgrade-assistant upgrade-assistant upgrade [projectName].csproj ``` -------------------------------- ### Install Episerver CLI Tool Source: https://docs.developers.optimizely.com/content-management-system/docs/set-up-a-development-environment Install the Episerver Command Line Interface (CLI) tool globally. This tool is required for managing Optimizely projects. ```shell dotnet tool install EPiServer.Net.Cli --global --add-source https://nuget.optimizely.com/feed/packages.svc/ ``` -------------------------------- ### TinyMCE Initialization Script Example Source: https://docs.developers.optimizely.com/content-management-system/docs/plug-ins An example of an AMD module that loads and returns a function to initialize the TinyMCE editor with custom settings. ```javascript define([], function () { return function (settings) { console.log("initialize TinyMCE advanced config"); return Object.assign(settings, { myCallback: function () { alert('hello'); } }); } }); ``` -------------------------------- ### View Mode URL Example Source: https://docs.developers.optimizely.com/content-management-system/docs/on-page-editing-with-client-side-rendering Example URL for delivering content to a site visitor in view mode. ```plaintext /en/artist ``` -------------------------------- ### Install OpenID Connect NuGet Package Source: https://docs.developers.optimizely.com/content-management-system/docs/integrate-azure-ad-using-openid-connect Install the necessary NuGet package for ASP.NET Core OpenID Connect authentication. ```powershell Install-Package Microsoft.AspNetCore.Authentication.OpenIdConnect ``` -------------------------------- ### Install EPiServer.CMS.UI.Sources NuGet Package Source: https://docs.developers.optimizely.com/content-management-system/docs/debugging-cms-ui Install the EPiServer.CMS.UI.Sources NuGet package to access original UI source files and uncompressed Dojo/Dijit. This package is useful for customizing Dojo builds. ```powershell Install-Package EPiServer.CMS.UI.Sources ``` -------------------------------- ### Install Optimizely CLI Tool Source: https://docs.developers.optimizely.com/content-management-system/docs/installing-optimizely-net-5 Installs the Optimizely Command-line Interface (CLI) tool globally. This tool is optional but simplifies database creation and updates. ```shell dotnet tool install EPiServer.Net.Cli --global --add-source\ https://nuget.optimizely.com/feed/packages.svc ``` -------------------------------- ### Preview Mode URL Example Source: https://docs.developers.optimizely.com/content-management-system/docs/on-page-editing-with-client-side-rendering Example URL for loading content in the CMS UI, rendered as it would appear in view mode. ```plaintext /EPiServer/CMS/Content/en/artists,,6_7/?epieditmode=False ``` -------------------------------- ### Install Optimizely CLI Source: https://docs.developers.optimizely.com/content-management-system/docs/install-a-sample-site Installs the Optimizely Command-line Interface (CLI) tool globally. This tool is optional and simplifies database creation and updates. ```bash dotnet tool install EPiServer.Net.Cli --global --add-source https://nuget.optimizely.com/feed/packages.svc ``` -------------------------------- ### Get Upgrade Assistant Help Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Access help information for the Upgrade Assistant, including available commands and options. ```shell dotnet run -- migrate --help ``` -------------------------------- ### Client-Side Initializer Class Example Source: https://docs.developers.optimizely.com/content-management-system/docs/configuring-moduleconfig Example of a client-side initializer class written in JavaScript using Dojo's 'declare'. Implement the 'initialize' method for custom module startup logic. ```javascript define(["dojo/_base/declare"], function (declare) { return declare([], { initialize: function () { // Do any custom module initialization here } }); }); ``` -------------------------------- ### Install Optimizely CMS Templates for Visual Studio Source: https://docs.developers.optimizely.com/content-management-system/docs/install-a-sample-site Installs a specific version (1.1.0) of Optimizely CMS templates, required when using Visual Studio to avoid compatibility issues with ASP.NET. ```bash dotnet new -i Episerver.Templates::1.1.0 ``` -------------------------------- ### package.json for NextJS Source: https://docs.developers.optimizely.com/content-management-system/docs/host-a-frontend-with-optimizely Example package.json script section for a Next.js application, defining build and start commands. ```json { "scripts": { "build": "next build", "start": "next start" } } ``` -------------------------------- ### Upload a New File with Content Source: https://docs.developers.optimizely.com/content-management-system/docs/working-with-media Creates a new file, sets its name, writes 'Hello world' to its binary data, and publishes it. Requires IContentRepository and IBlobFactory. ```csharp public void Uploading_a_file() { var contentRepository = ServiceLocator.Current.GetInstance(); var blobFactory = ServiceLocator.Current.GetInstance(); //Get a new empty file data var file1 = contentRepository.GetDefault(SiteDefinition.Current.GlobalAssetsRoot); file1.Name = "Readme.txt"; //Create a blob in the binary container var blob = blobFactory.CreateBlob(file1.BinaryDataContainer, ".txt"); using(var s = blob.OpenWrite()) { StreamWriter w = new StreamWriter(s); w.WriteLine("Hello world"); w.Flush(); } //Assign to file and publish changes file1.BinaryData = blob; var file1ID = contentRepository.Save(file1, SaveAction.Publish); } ``` -------------------------------- ### Initialize Content Repositories Source: https://docs.developers.optimizely.com/content-management-system/docs/inline-edit-settings Sets up the necessary repositories for content manipulation. Inject IContentRepository and IContentTypeRepository into your service or class. ```csharp using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.ServiceLocation; // For ServiceLocator.Current.GetInstance using EPiServer.DataAccess; // For SaveAction using System; using System.Collections.Generic; namespace MyProject.Business.InlineBlocks { public class InlineBlockCreationExamples { private readonly IContentRepository _contentRepository; private readonly IContentTypeRepository _contentTypeRepository; public InlineBlockCreationExamples() { _contentRepository = ServiceLocator.Current.GetInstance(); _contentTypeRepository = ServiceLocator.Current.GetInstance(); } // ... (Example methods below) } } ``` -------------------------------- ### Configure Services in startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/powerslice Add the Find service to the dependency injection container in the startup.cs file. This is a necessary step after configuring appsettings.json. ```csharp public void ConfigureServices(IServiceCollection services) { //… services.AddFind(); } ``` -------------------------------- ### Render Asset using GUID with HTML Helper Source: https://docs.developers.optimizely.com/content-management-system/docs/cmp-dam-in-cms Renders an asset directly using its GUID, which is useful when working with custom properties that store the asset GUID. ```cshtml @await Html.RenderTagWithMetadata(m => m.CurrentPage.AssetGuid) ``` -------------------------------- ### Run the Upgrade Assistant Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Use this command to initiate the Upgrade Assistant for a specified project or solution file. ```shell upgrade-assistant ``` -------------------------------- ### Configure OpenID Connect Services in Startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/paas-cms-core-openid Configure OpenID Connect services in the Startup.cs file, including application settings and redirect URIs. This setup is for development and debugging purposes. ```csharp services.AddOpenIDConnect < ApplicationUser > ( useDevelopmentCertificate: true, signingCertificate: null, encryptionCertificate: null, createSchema: true, options => { var baseUri = new Uri(_frontendUri); // _frontendUri is your application client url options.RequireHttps = !_webHostingEnvironment.IsDevelopment(); options.DisableTokenPruning = true; options.DisableSlidingRefreshTokenExpiration = true; options.Applications.Add(new OpenIDConnectApplication { ClientId = "frontend", Scopes = { "openid", "offline_access", "profile", "email", "roles", ContentDeliveryApiOptionsDefaults.Scope }, PostLogoutRedirectUris = { baseUri }, RedirectUris = { new Uri(baseUri, "/api/auth/callback/optimizely_cms"), new Uri("https://oauth.pstmn.io/v1/callback") // for trying out with postman purpose }, }); }); services.AddOpenIDConnectUI(); // No encrypt the token so it's easier to debug, not recommend for production. services.AddOpenIddict() .AddServer(options => options.DisableAccessTokenEncryption()); ``` -------------------------------- ### Adding DXP Support to a Plain CMS Project Source: https://docs.developers.optimizely.com/content-management-system/docs/resolving-nuget-dependency-conflicts-in-project-sdk-packagereference-model Demonstrates the process of installing EPiServer.CloudPlatform.Cms to a project initially referencing EPiServer.CMS, which can lead to dependency conflicts due to differing version requirements. ```powershell Install-Package EPiServer.CloudPlatform.Cms -Version 1.0.3 ``` -------------------------------- ### Resolve NullReferenceException during EPiServer 4.62B Installation Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrading-from-legacy-versions This error occurs during the installation of EPiServer 4.62B when using an online package, due to an issue with the licensing system. The solution involves creating an offline installation package. ```csharp at LicenseRegistry.LicenseCreator.CreateLicense(License license) at LicenseRegistry.DataAbstraction.License.CreateLicenseFile() at ProductUpdate.InstallUnit..ctor(Int32 licenseNumber, String licensedCompany) in C:\\LicenseRegistry\\Production\\ProductUpdate\\InstallUnit.cs:line 30 at ProductUpdate.UpdateManager.AddLicense(Product prod, InstallUnit[] units) in C:\\LicenseRegistry\\Production\\ProductUpdate\\UpdateManager.asmx.cs:line 132 at ProductUpdate.UpdateManager.RequestInstall(Product product) in C:\\LicenseRegistry\\Production\\ProductUpdate\\UpdateManager.asmx.cs:line 122 ``` -------------------------------- ### Show Help and Usage Information Argument Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Use the `-?`, `-h`, or `--help` arguments to display help and usage information for the Upgrade Assistant. ```shell -?, -h, --help ``` -------------------------------- ### Define Connector GUID Source: https://docs.developers.optimizely.com/content-management-system/docs/custom-connector Defines a static Guid for the connector. This unique identifier is used to identify the connector. ```csharp static internal Guid ConnectorGuid = new Guid("0D25D765-5BA8-49B8-AF6D-1AF2ECE30032"); ``` -------------------------------- ### Basic Initialization Module Structure Source: https://docs.developers.optimizely.com/content-management-system/docs/creating-an-initialization-module Implement this structure for a new initialization module. Ensure you add a reference to `EPiServer.Framework.dll`. The `Initialize` method sets up properties, and `Uninitialize` undoes these changes. ```csharp [InitializableModule] public class SampleInitialization: IInitializableModule { public void Initialize(InitializationEngine context) {} public void Uninitialize(InitializationEngine context) {} } ``` -------------------------------- ### Configure CMP Graph integration in Startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/cmp-dam-in-cms Configure CMP Graph integration by setting the SingleKey in Startup.cs and then adding the integration service. ```csharp services.Configure(options => options.SingleKey = "YOUR_CMP_GRAPH_SECRET"); services.AddDAMGraphIntegration(); ``` -------------------------------- ### Eloqua Customer GUID Retrieval Script Source: https://docs.developers.optimizely.com/content-management-system/docs/connect-for-eloqua This script ensures the Eloqua Customer GUID is retrieved and set for form submissions. It uses a timeout to wait for the GUID and assigns it to the 'elqCustomerGUID' hidden field. This script should be loaded on page load. ```javascript ``` -------------------------------- ### Response Example for Structured Rich Text Source: https://docs.developers.optimizely.com/content-management-system/docs/install-and-configure-optimizely-graph-on-your-site Example of a `MainBody` field response when configured to return structured JSON. ```json { "MainBody": { "Structure": "{\"type\":\"richText\",\"children\":[{\"type\":\"paragraph\",\"children\":[{\"text\":\"The weather is very nice !\",\"bold\":true}]}]}" } } ``` -------------------------------- ### Module Configuration File Example Source: https://docs.developers.optimizely.com/content-management-system/docs/developing-add-ons A minimal module.config file required in the NuGet package root. It specifies loading behavior, description, and assemblies. The tags attribute must contain EPiServerModulePackage or EPiServerPublicModulePackage. ```xml ``` -------------------------------- ### Response Example for HTML Rich Text Source: https://docs.developers.optimizely.com/content-management-system/docs/install-and-configure-optimizely-graph-on-your-site Example of a `MainBody` field response when configured to return raw HTML. ```text "MainBody": "

The weather is very nice !

" ``` -------------------------------- ### Response Example with Structure as JSON Source: https://docs.developers.optimizely.com/content-management-system/docs/install-and-configure-optimizely-graph-on-your-site Example of a `MainBody` field response when `RichTextStructAsJson` is enabled, showing `Structure` as a JSON object. ```text "MainBody": { "Structure": { "type": "richText", "children": [ { "type": "paragraph", "children": [ { "text": "Test" } ] } ] }, "Html": "

Test

" } ``` -------------------------------- ### Configure Content Allowlist in startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/install-and-configure-optimizely-graph-on-your-site Configure content syncing rules in `startup.cs` by setting `ContentIds` and `ContentTypes` arrays. This configuration overrides `appsettings.json`. ```csharp services.AddContentGraph(configureOptions: options => { options.Include.ContentIds = new int[] { 1, 2, 3 }; options.Include.ContentTypes = new string[] { typeof(StandardPage).Name, typeof(ProductPage).Name }; }); ``` -------------------------------- ### Response Example for HTML and Structured Rich Text Source: https://docs.developers.optimizely.com/content-management-system/docs/install-and-configure-optimizely-graph-on-your-site Example of a `MainBody` field response when configured to return both HTML and structured JSON. ```json { "MainBody": { "Structure": "{\"type\":\"richText\",\"children\":[{\"type\":\"paragraph\",\"children\":[{\"text\":\"The weather is very nice !\",\"bold\":true}]}]}", "Html": "

The weather is very nice !

" } } ``` -------------------------------- ### Configure OpenID Connect Authentication in Startup Source: https://docs.developers.optimizely.com/content-management-system/docs/integrate-azure-ad-using-openid-connect Configure OpenID Connect authentication in the `ConfigureServices` method of your `startup` class. The `OnSignedIn` event is used to synchronize user and group membership to Optimizely. ```csharp public void ConfigureServices(IServiceCollection services) { ... services .AddAuthentication(options => { options.DefaultAuthenticateScheme = "azure-cookie"; options.DefaultChallengeScheme = "azure"; }) .AddCookie("azure-cookie", options => { options.Events.OnSignedIn = async ctx => { if (ctx.Principal?.Identity is ClaimsIdentity claimsIdentity) { // Syncs user and roles so they are available to the CMS var synchronizingUserService = ctx .HttpContext .RequestServices .GetRequiredService(); await synchronizingUserService.SynchronizeAsync(claimsIdentity); } }; }) .AddOpenIdConnect("azure", options => { options.SignInScheme = "azure-cookie"; options.SignOutScheme = "azure-cookie"; options.ResponseType = OpenIdConnectResponseType.Code; options.CallbackPath = "/signin-oidc"; options.ClientSecret = "CLIENT SECRET"; options.UsePkce = true; // If Entra ID is register for multi-tenant //options.Authority = "https://login.microsoftonline.com/" + "common" + "/v2.0"; options.Authority = "https://login.microsoftonline.com/" + "TENANT ID" + "/v2.0"; options.ClientId = "CLIENT ID"; options.Scope.Clear(); options.Scope.Add(OpenIdConnectScope.OpenIdProfile); options.Scope.Add(OpenIdConnectScope.OfflineAccess); options.Scope.Add(OpenIdConnectScope.Email); options.MapInboundClaims = false; options.TokenValidationParameters = new TokenValidationParameters { RoleClaimType = "roles", NameClaimType = "preferred_username", ValidateIssuer = true }; options.Events.OnRedirectToIdentityProvider = ctx => { // Prevent redirects from being cached. ctx.Response.Headers.CacheControl = "no-cache,no-store"; // Prevent redirect loop if (ctx.Response.StatusCode == 401) { ctx.HandleResponse(); } return Task.CompletedTask; }; options.Events.OnAuthenticationFailed = context => { context.HandleResponse(); context.Response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes(context.Exception.Message)); return Task.CompletedTask; }; }); ... } ``` -------------------------------- ### Using Localization Functions in a Component Source: https://docs.developers.optimizely.com/content-management-system/docs/localizing-the-visitor-group-criterion Demonstrates how to initialize localization with a path, define a value, and then use the localize function to translate a string with placeholder values. This example shows how to achieve dynamic content translation. ```csharp out of {0} pages initLocalization('page'); const value = 10; localize('amount', 'My fallback text', [value]) // Results in "out of 10 pages" ``` -------------------------------- ### Edit Mode URL Example Source: https://docs.developers.optimizely.com/content-management-system/docs/on-page-editing-with-client-side-rendering Example URL for loading content in the CMS UI for editing in Optimizely Page Editor (OPE). ```plaintext /EPiServer/CMS/Content/en/artists,,6_7/?epieditmode=True ``` -------------------------------- ### Example GA4 Currency Script Source: https://docs.developers.optimizely.com/content-management-system/docs/google-analytics-for-optimizely This is an example of the script lines that will be added after the initial tracking script to set the currency in Google Analytics. ```javascript gtag('set', {currency: 'USD'}); ``` -------------------------------- ### Enable CMP DAM library picker in Startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/cmp-dam-in-cms Add this to your IServiceCollection configuration in Startup.cs to enable the CMP DAM library picker UI. ```csharp public void ConfigureServices(IServiceCollection services) { // Enable CMP DAM library picker services.AddDAMUi(options => options.Enabled = true); // ... other service configuration } ``` -------------------------------- ### Configure ScriptParserOptions in startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/filter-javascript-from-properties-and-files Configure script parsing options programmatically in the startup.cs file to control how JavaScript is handled during loading, saving, and media uploads. This includes setting parsing modes, specifying media extensions, defining illegal URI schemes, and configuring element attribute handling. ```csharp public void ConfigureServices(IServiceCollection services) { // ... existing configuration ... // Configure ScriptParserOptions services.Configure(options => { // Configure parsing modes options.LoadingMode = ScriptParserMode.Remove; // Remove scripts when loading from database options.SavingMode = ScriptParserMode.ThrowException; // Throw exception when saving scripts options.MediaUploadMode = ScriptParserMode.ThrowException; // Throw exception when uploading media with scripts // Configure which media file extensions should be parsed for scripts options.MediaExtensionsToParse = new[] { ".svg", ".svgz", ".html", ".htm", ".xml" }; // Configure illegal URI schemes options.IllegalUriSchemes = new List { "javascript"}; // Configure element attributes handling options.Mode = ScriptParserOperationMode.Block; // Block mode (blacklist) // Clear default settings and add custom rules options.ElementAttributes.Clear(); // Block all "on*" event attributes on all elements options.ElementAttributes.Add("*", "on*"); // Block specific attributes on specific elements options.ElementAttributes.Add("img", "onerror,onload"); // Alternative: Use Allow mode (whitelist) // options.Mode = ScriptParserOperationMode.Allow; // options.ElementAttributes.Clear(); // options.ElementAttributes.Add("div", "class,id,style"); // options.ElementAttributes.Add("img", "src,alt,class,id"); }); // ... rest of your existing configuration ... } ``` -------------------------------- ### Custom Tracking Script Example Source: https://docs.developers.optimizely.com/content-management-system/docs/google-analytics-for-optimizely An example of a custom tracking script that can be added to a page's footer, using the Measurement ID placeholder. ```html ``` -------------------------------- ### Configure CMP API integration in appsettings.json and Startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/cmp-dam-in-cms Recommended approach for secrets management: configure CMP API credentials in appsettings.json and then register the client in Startup.cs. ```json { "Optimizely": { "Cmp": { "ClientId": "YOUR_CLIENT_ID", "ClientSecret": "YOUR_CLIENT_SECRET" } } } ``` ```csharp services.AddOptimizelyCmpClient(); ``` -------------------------------- ### Start Page Rendering View Source: https://docs.developers.optimizely.com/content-management-system/docs/templatedescriptor-and-tags The rendering view for the start page, which displays content from MainBody and GeneralContentArea, applying a 'Sidebar' tag to the latter. ```cshtml @model MyOptimizelySite.Models.Pages.StartPage
@Html.PropertyFor(m => m.MainBody)
@Html.PropertyFor(m => m.GeneralContentArea, new { Tag = "Sidebar" })
``` -------------------------------- ### Configure CMP API integration in Startup.cs Source: https://docs.developers.optimizely.com/content-management-system/docs/cmp-dam-in-cms Configure CMP API authentication directly in Startup.cs using Client ID and Client Secret. ```csharp services.AddOptimizelyCmpClient(options => { options.ClientId = "YOUR_CLIENT_ID"; options.ClientSecret = "YOUR_CLIENT_SECRET"; }); ``` -------------------------------- ### Convert EPi Add-ons Source: https://docs.developers.optimizely.com/content-management-system/docs/installing-add-ons Run the Convert-EPiAddons cmdlet in the Package Manager Console to convert existing add-ons installed via the UI to the Visual Studio format. This is necessary if the installationMode was previously set to 'UI'. ```powershell Convert-EPiAddons ``` -------------------------------- ### Example ID Token Source: https://docs.developers.optimizely.com/content-management-system/docs/paas-cms-core-openid This is an example of a JSON Web Token (JWT) used for OpenID Connect authentication. It contains claims about the authenticated user and session. ```Text eyJhbGciOiJSUzI1NiIsImtpZCI6IkY3RUVBN0UzQTJCODhGOUVFMDRBNjczNzEyRENGQTAwRjhBNEQxOEQiLCJ4NXQiOiI5LTZuNDZLNGo1N2dTbWMzRXR6NkFQaWswWTAiLCJ0eXAiOiJKV1QifQ.eyJzdWIiOiIxMTdkM2UwYy03ZDMwLTQyMGUtYWYxYi02ZTczZGVmOTEwNDciLCJvaV9hdV9pZCI6IjgxZWRlYTIzLTZmZDgtNDQ5Ny05MDY1LWZmNzk4M2E0YjhmOCIsImF6cCI6ImZyb250ZW5kIiwiYXRfaGFzaCI6IlBrYW93ZVRidExHNWx4alZOZEgwRmciLCJvaV90a25faWQiOiJlODVmMTdlNC1jMDg4LTRlODQtOTI3ZC1hNDU2MzczZDU2YTQiLCJhdWQiOiJmcm9udGVuZCIsImV4cCI6MTcwMzU2MzQxMSwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgyLyIsImlhdCI6MTcwMzU2MjIxMX0.NuuTGBOxDsvatOZgQAc6zwISbn-DAyQcSi3kWVKywU58h_4inNYPEvFY3wTdLrWN9vIg6lsWexEeF5_rx58np3aIUNIpuqrXTed0tsPCrGvQcEljs39epwbcEYtxZnSUIelMSwZQF4nXlAELQemQhukVdQu5zrJIAQLAQ176cAp7QG7Y1eEn5WfGFdxuRCWbBzl_i0SjCWKSYeePeQ8or3cYgCYZ2FmnhoKLJkIfaWdgkh2F1toVpyz4KZKMKJtHMaKF6FZjEcQUm8M8r-YkbPVF7Zm1wDe9cepeMWGjXwouAZW4GAMUVheIdN3TRrend2KMwAizJMOpZQbCFj0NZg ``` -------------------------------- ### ExtensionManifest.json Configuration Example Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant This JSON file configures settings for migrating Optimizely-specific code. It includes sections for updating configurations, mapping packages, and inserting templates. ```json { "ConfigUpdater": { "ConfigUpdaterPath": "ConfigUpdaters" }, "PackageUpdater": { "PackageMapPath": "PackageMaps" }, "TemplateInserter": { "TemplateConfigFiles": [ "Templates\\EPiServerTemplates\\TemplateConfig.json" ] } } ``` -------------------------------- ### Write Video Started Event to ODP Source: https://docs.developers.optimizely.com/content-management-system/docs/odp-cms-1 Sends a 'started' event to ODP when video playback begins. Includes video ID, title, and progress. ```javascript function writeStartVideoEvent() { console.log("ODP - video started"); if (sendEvents) { zaius.event("video", { action: "started", video_id_yt: videoId, video_title: videoTitle, video_play_percentage: 0, video_action: true }); } } ``` -------------------------------- ### Update the .NET Upgrade Assistant Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Updates an existing global installation of the Upgrade assistant to the latest stable version. Ensure you have the tool installed before running this command. ```shell dotnet tool update -g upgrade-assistant ``` -------------------------------- ### Specify Entry Point Argument Source: https://docs.developers.optimizely.com/content-management-system/docs/upgrade-assistant Use the `-e` or `--entry-point` argument to define the entry-point project for the upgrade process. Globbing patterns like '*' are supported. ```shell -e, --entry-point ``` -------------------------------- ### Install and Import EpiCloud Module Source: https://docs.developers.optimizely.com/content-management-system/docs/host-a-frontend-with-optimizely Installs and imports the EpiCloud PowerShell module, required for managing Optimizely deployments. Ensure you have EpiCloud version 1.10 or higher. ```powershell Install-Module EpiCloud Import-Module EpiCloud ``` -------------------------------- ### Implement Widget Command Consumer Mixin Source: https://docs.developers.optimizely.com/content-management-system/docs/plugging-in-commands This example demonstrates how to add custom plug-in capabilities to widgets using the `_WidgetCommandConsumerMixin`. It defines a `commandKey` to allow third-party extensions to plug into the widget's menu. ```javascript define("samples.Toolbar", [ // Dojo "dojo/_base/array", "dojo/_base/lang", "dojo/_base/declare", "dojo/_base/lang", // Dijit "dijit/_Widget, "dijit/_Container", "dijit/form/Button", // EPi CMS "epi/shell/command/_WidgetCommandConsumerMixin" ], function ( // Dojo array lang, declare, lang, // Dijit _Widget, _Container, Button, _WidgetCommandConsumerMixin) { return declare("samples.Toolbar", [_Widget, _Container, _WidgetCommandConsumerMixin], { //Get commands that has been registered to the global toolbar commandKey: "epi.cms.globalToolbar", onCommandsChanged: function (name, removed, added) { //Add a button for each command array.forEach(added, lang.hitch(this, function (command) { //Create a button and bind onClick to command.execute this.addChild(new Button({ label: command.label, onClick: function () { command.execute(); } })); })); array.forEach(removed, function (command) { //Remove the commands }); } }); } ); ``` -------------------------------- ### Remove Prior Integration Packages Source: https://docs.developers.optimizely.com/content-management-system/docs/cms-cmp-publishing-integration Before installing the new integration, remove any previous versions of the orchestration and client packages. This ensures a clean installation and avoids conflicts. ```powershell dotnet remove package EPiServer.CMS.OrchestrateIntegration # If explicitly installed, also run: dotnet remove package Optimizely.Content.Service dotnet remove package Optimizely.Cmp.Client ```