0

I have a multilingual Drupal 8.7.10 site (English and Czech, in this case).

Content types Article and Basic Page are translatable and both have some Entity reference field referencing some Media type. This field is also translatable so I can reference different media in each language version of the same content item. This works fine, so e.g. English version of some article displays links to media A and B, while Czech version of the same article displays links to media B, C and D.

Things get complicated with Basic Page content type. I do not want to display referenced media "inside" the Basic Page, but in some View (displaying required Media type) in a sidebar. I managed to configure contextual filter for this View using relationship to the Entity reference field in Basic Page type and providing Content ID from URL for this filter. See image:

field_documents_ve_strance is my Entity reference field in Basic Page

After some additional tweaking (removing duplicated results) it works fine, but:

I am not able to list (in that view) only media referenced in the current language version of the page. E.g. if English version of some Basic Page references media A and B and Czech version of the same page references media B and C, my view lists media A, B and C on both English and Czech version of the page.

Is there any way filter the view to display only media referenced from the current language version of the Basic page (or any other content type, of course)?

Your Answer

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

Browse other questions tagged or ask your own question.