0

This question already has an answer here:

For an item I have 2 version for 2 languages with a different displayName for each. The displayName are :

  • Item_01_EN for the EN version
  • Item_01_FR for the FR version

Now the problem is, when I use LinkManager.GetItemUrl(item, opts) with my opts.Language set to the FR culture, sitecore keeps generating an URL with Item_01_EN displayName instead of Item_01_FR.

How can I solve this ?

marked as duplicate by Mark Cassidy Aug 29 '17 at 11:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

It should work if you set in your options useDisplayName = true Have you tried it?

  • 2
    It won't, actually. But it's all covered in the linked resolution answer. – Mark Cassidy Aug 29 '17 at 11:27
  • The problem was generating the link using the diplayname, or generating the link for a language different to the language used to get the item? – Vicent Galiana Aug 29 '17 at 11:38
  • 1
    Item language, options language and context language in beautiful mix, yea ;-) Not OPs fault. – Mark Cassidy Aug 29 '17 at 11:39
  • The problem was generating the link using a displayName which varies depending on the language of the item :) From what I understood, I'll have to load manually the item in the target language to pass it to my LinkManager. I'll edit my first post with the solution, thank you guys ! – TeKilla Aug 29 '17 at 12:06
  • Glad it worked out :-) Please don't edit in solutions to the question text; it confuses search engines. And there is already a redirect in place to the solution answer. If you feel that the answer needs to be elaborated further, feel free to add an additional answer on the linked question :-) – Mark Cassidy Aug 29 '17 at 13:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.