![]() ![]() This was done using version 8.x-3.8 of the Search API Solr module. This was not an issue for the example site as all the content started with English and was later translated, but this could create problems if your content is originating from multiple languages. Keep in mind that if any entities in your view do not have a version in the default language, they will not show up, even if the page is set to the language they do have. This filter also removes any duplicates, because the language is held constant during the query. This means that all the entities in your view will display in the requested language, but default to your default language so nothing gets left out. Click Add to get the Filter Criteria pop-up. In the view edit page, find the Filter Criteria section on the left side under the Fields section. If you are unfamiliar with adding a filter to a view, check out these instructions from .ġ. Because of this discrepancy, regular entity views and indexed entity views need different solutions. Additionally, if this is a view of indexed entities, then the language rendering options which fix the above issues are not available. ![]() However, if you filter by the page’s interface language, the database will only return entities translated in the page’s language. The database contains separate rows for each translation of an entity, so when the view queries it without specifying a language, it can return duplicates of the same entity. What could go wrong with multilingual Drupal 8 views? It starts with how views get data and how translations are stored in Drupal. if an entity does not have the requested French or Spanish translation, then display the English version.users can choose to view the site in French or Spanish regardless of available translations.So get ready to learn how to display multilingual Drupal 8 views of entities (such as nodes, media, and taxonomy terms) as well as entities indexed through the Drupal 8 Search API module.Ī multilingual Drupal 8 website with these guidelines: However, you can quickly run into complications when implementing a view, especially if your website is multilingual. It takes advantage of Drupal’s structure to create features from recommended content to directories and search pages. ![]() The Drupal 8 core Views module is a big part of why Drupal 8 websites work so well. ![]()
0 Comments
Leave a Reply. |