3

So I have 2 translatable content types: event and artist. I've also created an English artist and his French translation.

I now create an English event and link my English artist to it through Entity References. If I now translate my English event to French, my French event will have a reference field with my English artist instead of my French artist...

How can I solve this problem?

I want it to try to fetch the translated reference and if it does not exist, I want to entity referenced field to stay empty.

1

Some people told me this happends on default, but I've just set up a test site with i18n and entityreferences enabled, and it gives the same result.

But I found a sandbox project that worked for me after changing one line of code in the entityreference_translation.module:

This didn't work:

if ($item['target_type'] == "node") {

This works:

if ($field['settings']['target_type'] == "node") {
0

You can make the reference field as synchronised. That way you need to link to English artist once only. So if you link from French event to English artist and if it has French version then it'd be automatically redirected to the French version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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