Localize dynamic content items

To localize dynamic content items, you set the required culture by passing it as a parameter to the Lstring properties of the item.

In the following code example, you localize a dynamic content item that you created using the Dynamic Module Builder. 

In the example below, you perform the following:

  1. Get an instance of the DynamicModuleManager class.
  2. Resolve the name of the dynamic content type using the TypeResolutionServiceclass.
  3. Check whether a dynamic content item with the same ID already exists. 
    If an item with the same ID does not exist, create the dynamic content item by calling the CreateDataItem method of the DynamicModuleManager class. 
  4. Set the properties of the dynamic content item object.
    Passing the culture when setting the Title ensures that the dynamic content item is localized for that specific culture.
  5. Recompile the URLs of the dynamic content item.
  6. Set the ApprovalWorkflowState of the desired localized version by passing the specific culture.
  7. Publish the dynamic content item to the Live state using the content lifecycle of the DynamicModuleManager class.
  8. Save the changes.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Localize products