microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
388 stars 341 forks source link

Issue with Displaying Multilingual News on SharePoint PNP Modern Search Page #4068

Closed h3nn3 closed 3 weeks ago

h3nn3 commented 4 weeks ago

Hello community :),

I have a SharePoint site with multilingual capabilities activated, and the default language is English. Here is the scenario:

  1. I create a news post in English and translate it into German.
  2. I create another news post in English but do not translate it into German.

I then create a search page, which is initially in English. From this search page, I create a German version. On the German search page, I want to display all news posts. However, I want the following behavior:

I have reviewed other posts and tried the following query snippet, but it does not work in my scenario:

(SPTranslationLanguage:{Page._SPTranslationLanguage} OR (-SPTranslatedLanguages:{Page._SPTranslationLanguage} AND -SPIsTranslation:true))

Goal: The goal is to ensure that the end user sees all news posts on the search page. If a news post is available in German, only the German version should be shown. If a news post does not have a German translation, the default English version should be displayed to ensure no information is missed.

Request: Could you please provide guidance or a solution to achieve this functionality?

Thank you!

kasperbolarsen commented 3 weeks ago

The article might be just what you are looking for: https://www.techmikael.com/2020/09/search-and-modern-multilingual-pages-in.html