有没有办法在sitecore中发布我们从与该项目关联的API获得的某种特定语言的项目?
Language[] languages = new Language[] { LanguageManager.GetLanguage("en") };
....
...
Sitecore.Publishing.PublishManager.PublishSmart(master, targetDbs, languages);
我在Sitecore Env这里有三种语言,但是我想要一个项目只发布“en”语言,其他只发布“en-ca”而其他只发布“fr-ca”。
答案 0 :(得分:1)
您需要使用PublishItem
方法并按以下步骤操作:
示例代码
//Get your Item list here
var itemList = GetItemList();
//Loop in the Item list to get the languages
//Publish the item based on the languages
foreach (var item in itemList)
{
var languageVersions = item.Languages;
Sitecore.Publishing.PublishManager.PublishItem(item, targetDb, languageVersions, true, false);
}
由于