如何使用Sitecore添加具有预定义语言的项目?

时间:2014-01-20 12:37:53

标签: c# asp.net sitecore

对于我正在使用Sitecore 6.5的项目。这是一个多语言项目。我想程序代码中添加项目 预定义语言,例如荷兰语。

我搜索了整个互联网,但我找不到正确的方法。有谁知道我怎么解决这个问题?

非常感谢。

的Jordy

1 个答案:

答案 0 :(得分:8)

第一次在荷兰语中获得父项:

Language languageDutch=Language.Parse("nl-nl");

   ////parentItemId is the item under you want to create child
   Item parentItem=Sitecore.Context.Item.GetItem(parentItemId, Language languageDutch)

在荷兰语中创建子项目之后:

parentItem.AddItem("child item name",TemplateId)