HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunitySubmit a ticketLog In

Migrate dynamic content to blocks

Describes how to programmatically insert content into XHTML property values.

🚧

Caution

Dynamic content is deprecated in Optimizely Content Management System (CMS 12). Use blocks instead. While existing solutions will continue to work, you should not build new solutions on this API. It will be phased out in the future.

Optimizely dynamic content is a feature that lets developers programmatically insert content into XHTML property values. The optional NuGet package EPiServer.DynamicContent installs Optimizely dynamic content. However, the feature is now deprecated, and Optimizely TinyMCE v2 does not support it. You should use blocks instead.

If your site uses dynamic content, you can use the procedures in this topic to migrate from dynamic content to blocks.

Approach

  1. Identify and iterate the items that use dynamic content.
  2. Get the original content saved by the dynamic content control and extract the content for migration.
  3. Create a block to render the dynamic content control.
  4. Create a block to replace the dynamic content control at the page level.
  5. Update the XHTMLstring property.

Resources

You can find a working solution on GitHub on the branch doc/migrating-dynamic-content

Clone the repository, check out that branch, and run it as described in the Readme file, which implements the above approach as a scheduled job. It identifies instances of FooDynamicContent and rewrites them to instances of FooBlock.