0

On a multilingual drupal website (version 9.2.10) A block duplicates content on the landing page when 2 of more languages are enabled.

The block shows random published content for a custom content type in a grid system with a cards layout.

Due to 2 extra enabled languages, for example Dutch and German, Dutch content is duplicated and showed 3 times in this views grid now.

This duplication of content didn't appear when the languages where disabled.

Currently the view is rendering language by the selection "interface text language selected for page"

Update current view settings:current view settings Note:

  • under Advanced --> Query settings --> Distinct is enabled
      query:
        type: views_query
        options:
          disable_sql_rewrite: false
          distinct: true
          replica: false
          query_comment: ''
          query_tags: {  }

View displays duplicates of "Humo Dutch": duplicates of Humo Dutch

2
  • Seeing your current Views config would help find a solution. Undesirable duplication of results is a common problem in Views. (Off the cuff, grouping by language might be of help.)
    – beltouche
    Nov 30, 2021 at 19:28
  • When switching languages the view is showing the right content. Only duplicated. I added some config as an update in the answer. Need of the whole yml output?
    – Joehoe
    Nov 30, 2021 at 20:10

1 Answer 1

4

It's duplicated because you displaying now all the languages. You need to make sure on a multilingual site, that you list a single language per content in views. The suggested by me, to add a filter with Default translation (= True). Then set the rendering language to the correct type which you need. This will ensure that all contents will be displayed. However, if you have content that is not translated, it will be visible in the original language. If you need to display only the current language you can set the content language filter (Translation language (= interface text language selected for page)) instead of the original, but in this case, there's no fallback language.

2
  • Hi there, While adding a filter criteria the suggested "Original language" filter didn't work but instead I used the filter criteria "Translation language (= interface text language selected for page)" If you could update this in your answer I can accept your answer as useful.
    – Joehoe
    Dec 1, 2021 at 9:40
  • Ah yes, because it's called "Default translation (= True)" Dec 2, 2021 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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