November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Haven't it tried by myself, but can you try to capture result from first .Save() and then pass that value to second .CreateLanguageBranch() method?
Creating new language branch programmatically should be straight forward. http://tedgustaf.com/blog/2010/5/create-a-new-page-language-branch-programmatically-in-episerver/
I want to create a page in 2 different language programmatically, but however it creates only 1 page, below is the code i am using
//adding english cunard page
myPage.PageName = dataToSave.ProductPageDetails.ProductName;
myPage.URLSegment = EPiServer.Web.UrlSegment.CreateUrlSegment(myPage);
myPage.PageName = dataToSave.ProductPageDetails.ProductName;
myPage.URLSegment = EPiServer.Web.UrlSegment.CreateUrlSegment(myPage);
//create page in english language
myPage = DataFactory.Instance.CreateLanguageBranch(myPage.PageLink, new LanguageSelector("en-cunard"));
DataFactory.Instance.Save(myPage, EPiServer.DataAccess.SaveAction.CheckIn, EPiServer.Security.AccessLevel.NoAccess);
//create page in german language
myPage = DataFactory.Instance.CreateLanguageBranch(myPage.PageLink, new lLnguageSelector("de-cunard"));
DataFactory.Instance.Save(myPage, EPiServer.DataAccess.SaveAction.CheckIn, EPiServer.Security.AccessLevel.NoAccess);
In above code it creates page in 1 languge only which is the last one (de-cunard).