Skip to main content
Support Help Center Help Center home page
Submit a request Sign in
  1. Support Help Center
  2. Optimizely support
  3. API

Loop Through Languages of a Page

  • October 03, 2017 16:33

Description

Below is a code sample of how to loop through language versions of a page.

Resolution

foreach (var pageLanguage in pageTypeData.ExistingLanguages)
{
    var repository = ServiceLocator.Current.GetInstance<IContentLoader>();
    var test1 = repository.Get<PageData>(pageTypeData.ContentGuid, pageLanguage);
}

Articles in this section

  • Dynamic Data Store Remap EPiServer.Core.PageObject
  • Deleting old content versions using the API
  • Enable special characters in URL Segment
  • How to stop a custom job in Admin UI in case your job has a loop.
  • Simple sample on how to use interfaces and allowed types on cms 12
  • How to translate an internal url to external url
  • How to filter out expired content in Episerver Search
  • Import Data not updating properties
  • Using CultureSpecific attributes on MediaData
  • Resources to Create a Controller in Alloy

See all 35 articles

Optimizely Website
Deutsch