November Happy Hour will be moved to Thursday December 5th.

Create page in secondary language

Vote:
 

Hi,

Is it possible to create a page programmatically in secondary language, and not have that in the primary language.

Thanks

#123352
Jul 02, 2015 11:40
Vote:
 

Hi,

Do you mean that all pages are in English and you need new page in Swedish (it not difficult)? 

Or you want to crete Language Branch without Language (it could be difficult)?

#123356
Jul 02, 2015 12:19
Vote:
 

In our case the new page should only be added to the language it was created from. For example if the page is created from english language then it should be available in english, if the page is created from german language that it should be available only in german langugae.

Thanks

#123357
Jul 02, 2015 12:21
Vote:
 

Did you tried simply set the Language property?

 IContentRepository cr = ...
var page = cr.GetDefault<ModelType>(ContentReference.StartPage);
page.Language = new CultureInfo("de");
#123359
Jul 02, 2015 12:27
Vote:
 

I tried it, it says LanguageBranchID is null

#123361
Jul 02, 2015 12:32
Vote:
 

There is also overload version of GetDefault. Maybe this will work?

IContentRepository cr = ...
var page = cr.GetDefault<ModelType>(ContentReference.StartPage,new CultureInfo("de"));
#123362
Jul 02, 2015 12:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.