Dev guideRecipesAPI ReferenceChangelog
Dev guideRecipesUser GuidesNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Advanced features

Discover the advanced features Optimizely Graph provides when you pair it with Content Management System 12 (CMS 12).

Connect Optimizely Content Management System 12 (CMS 12) with Optimizely Graph to enable advanced integration features, including multilingual support, preview-mode integration in the UI, and custom content processing. These capabilities help editors deliver localized experiences, preview unpublished content, and run custom transformations before indexing.

Multilingual support

Reach a global audience by serving CMS 12 content in each visitor's preferred language. Optimizely Graph detects the languages enabled in CMS 12 and indexes each language version as a separate node, so localized queries return the correct results.

Optimizely CMS 12 supports multilingual content through its globalization system. The Optimizely Graph integration detects and handles languages enabled in CMS 12, so users receive information in their preferred language.

Configure language options

Configure language options by updating the QueryOptions settings. Optimizely Graph reads language configuration from the globalization settings in CMS 12.

services.Configure<QueryOptions>(options =>
{
    // Language configuration is handled through CMS globalization settings
    // Content Graph will automatically detect enabled languages from CMS
});

Multi-language content type example

Use the ILocalizable interface to create content types that support localization.

[ContentType(DisplayName = "Multi-language Article")]
public class MultilingualArticle : PageData, ILocalizable
{
    [Display(Name = "Title")]
    public virtual string Title { get; set; }
    
    [Display(Name = "Content")]
    public virtual XhtmlString Content { get; set; }
    
    // Language-specific metadata
    public virtual string MetaDescription { get; set; }
}

After you publish the content type, Optimizely Graph indexes each language version as a separate node and maintains localization and metadata handling.

Preview mode integration

Give editors confidence in their work by previewing unpublished CMS 12 content in front-end applications. Configure Optimizely Graph with secure preview tokens so editors validate layout and copy before publishing.

Configure Optimizely Graph to work with CMS preview mode. This lets editors preview content in front-end applications with live preview tokens.

Enable preview mode

Enable preview mode and sync preview URLs by configuring the AddContentGraph service.

services.AddContentGraph(options =>
{
    options.EnableSynchronizeMenu = true; // Enables the UI menu
    
    options.Events.OnGeneratingPreviewUrl = context =>
    {
        // Generate preview URLs for front-end applications
        var baseUrl = "https://mysite.com";
        var previewUrl = $"{baseUrl}/api/preview?ref={context.ContentReference}&lang={context.Language.Name}";
        
        context.UpdateUrl(new Uri(previewUrl));
        return Task.CompletedTask;
    };
});

Configure preview UI options

Enable inline blocks and secure preview tokens for editors through the UI configuration in CMS 12.

services.Configure<UIOptions>(uiOptions =>
{
    uiOptions.UsePreviewTokens = true;
    uiOptions.InlineBlocksInContentAreaEnabled = true;
});

This configuration lets editors generate secure, shareable preview links for localized content.

Process content

Shape content before it reaches Optimizely Graph by hooking into the CMS 12 event system. Use this approach to enrich metadata, clean HTML, or apply transformations that improve search relevance and data quality.

Use the event system in CMS integration to process and transform content before indexing in Optimizely Graph.

Implement custom content logic

Customize how the system processes content before indexing by subscribing to content events in CMS 12.

public class CustomContentEventHandler : IInitializableModule
{
    public void Initialize(InitializationEngine context)
    {
        var events = context.Locate.Advanced.GetInstance<IContentEvents>();
        
        events.SavingContent += (sender, args) =>
        {
            // Transform content before it gets indexed
            if (args.Content is ArticlePage article)
            {
                // Add custom processing logic
                // The Content Graph integration picks up these changes
            }
        };
    }
}

Custom event handlers let you transform, validate, or enrich content before syncing with Optimizely Graph. Use them to add computed fields, clean HTML, or apply transformations to metadata.