Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Content link is not properly cultured when retrieved from different culture

Vote:
 

I have a variant (v1) in a language A and another variant (v2) in another language B. Both of those variants are created in master language C and published in master and respective languages.

When I retrieve all variant as given below in language A or B, everything including contentlink is fine.
_contentRepository.GetChildren<Variant>(contentLink);

If I am at language B and retrieve all variant from A as well (or vice versa) as given below, I get proper content link v2 but for v1 I get content link of master language.
foreach(var culture in cultures)
_contentRepository.GetChildren<Variant>(contentLink, new CultureInfo(culture));

Even if I try to resolve as below, it does not work. GetUrl gives proper string url but could not get contentreference.
ContentReference.Parse(_urlResolver.GetUrl(v1.ContentLink, culture))

#210557
Nov 27, 2019 16:42
Vote:
 

That scenario you've described sounds like the correct behaviour to me. 

"I have a variant (v1) in a language A and another variant (v2) in another language B"

"If I am at language B and retrieve all variants..... I get proper content link v2 but for v1 I get content link of master language".

You will get the master language because for variant v1 isnt available in that language. If you navigate to v1 in EPiServer, and access language B from the available languages (in the all property view), does EPiServer prompt you to create a language branch for that variant, in that language?

#210561
Nov 27, 2019 17:35
Muller - Nov 28, 2019 3:31
Variant v1 isnt available in that language(B), but I am expecting to get v1 in A. Also, I am not get prompted anything.
* 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.