A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi!
Here is some sample code that does a property for property copy from the current language to the hard coded language branch "SV". You can probably modify the code to fit your needs:
LanguageSelector selector = new LanguageSelector("SV");
PageData newLanguage = DataFactory.Instance.CreateLanguageBranch(CurrentPageLink, selector);
foreach (PropertyData property in CurrentPage.Property)
{
if (!property.IsLanguageSpecific || property.IsMetaData)
{
continue;
}
newLanguage[property.Name] = property.Value;
}
newLanguage.PageName =
CurrentPage.PageName + "- copy";
DataFactory.Instance.Save(newLanguage, SaveAction.Publish);
Regards
Linus Ekström
EPiServer Development Team
LanguageSelector selector = new LanguageSelector("SV");
PageData newLanguage = DataFactory.Instance.CreateLanguageBranch(CurrentPageLink, selector);
foreach (PropertyData property in CurrentPage.Property)
{
if (!property.IsLanguageSpecific || property.IsMetaData)
{
continue;
}
newLanguage[property.Name] = property.Value;
}
newLanguage.PageName =
CurrentPage.PageName + "- copy";
DataFactory.Instance.Save(newLanguage, SaveAction.Publish);
on.Publish);
I'm trying to copy a page with all its properties to a new language branch. Both CreateWritableClone and Createlanguagebranch don't copy the page properties. Is this possible?