Language fallback for (reusable) content items

Hello all,

We are in the process of rebuilding an existing site and are having some issues with language fallback.

We are using:

RetrieveCurrentPageParameters
ContentRetriever -> RetrieveCurrentPage

For the parameters we are providing LinkedItemsMaxLevel (4 in this case) and UseLanguageFallbacks set to true.

The content model is basic and as recommended by Kentico:

  • PageModel
  • Model itself (linked on the Page)

So in this case when retrieving the PageModel for a certain page it also retrieves the content of the (reusable) content from the Model itself. That's working and fine. Next up, that Model holds some text fields but again, some reusable content. A header image and another content item.

When we don't select a header image in a secondary language variant (ie. we leave that field empty) it doesn't get the linked reusable content item from the main culture.

The work around is to link the reusable content item in all 3 language variants and then not selecting an image asset in the secondary/tertiary language variants (to avoid triplicating all these media assets). However this still means you have to select the header image in all these variants when it should just fallback already.

What are we doing wrong, and how do we get this to work properly?

Environment

Answers

Programmatically it would be very difficult to distinguish "I didn't link it in the language variant because I don't want it" vs "I didn't link it in the language variant because the main language has a link."

I think if all the language variants all linked to the same primary language item, when you get the language specific parent, it may be linked to the main language child but it should grab a language specific child if it exists.

I think you just need to keep the links even on the variants. Did you try that and did that work? NOT necessarily linking the language variant parent to the language variant child, but the language variant parent to the main language child and say to try to get the language variant for everything?

To response this discussion, you have to login first.