Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
Ia m looping through the Composer blocks on my page and I need to get the Welsh Translated content from the block - but no matter what i use I always get the English. Can you see in my code where Im going wrong:
PageDataCollection allLanguages = DataFactory.Instance.GetLanguageBranches(child.PageLink); foreach (var tt in allLanguages.Where(x => x.LanguageID == child.LanguageID)) { try { ExtensionPageData page = ExtensionPageData.Load(tt.PageLink); if (page != null && page.AreaCount > 0) { List functions = page.GetAllContentFunctions(true);
if (functions.Count > 0)
{
foreach (var item in functions)
{
ContentFunctionReference cfr = new ContentFunctionReference(item.FunctionID, item.WorkID);
PageData pdCurrent = EPiServer.DataFactory.Instance.GetPage(cfr, new LanguageSelector(tt.LanguageID));
if (pdCurrent.PageTypeName == "[ExtensionSys] Text")
{
var pd = pdCurrent.GetPageLanguage(pdCurrent.LanguageID);
output += pdCurrent.Property["Content"].ToString() + " ^^^ " + tt.PageLink.ID + " -- " + child.LanguageID;
}
}
}
else
{
output = "NOTHING";
}
}
}
catch (Exception ex)
{
}
}
Thanks
Jon