Data List, Examine Query - passing language variant to get items call. #396
-
Hi @leekelleher , I hope you are well. We have a site built in Umbraco 11 that uses language variants, we have configured a contentment DataList field using an Examine Query to return items based on the _NodeTypeAlias. The Name field is set to nodeName. We noticed that when the Umbraco editor is loading a node that includes this field, Umbraco is calling the data list items api once per language variant (e.g. en-gb, fr-fr etc.), but the returned items from Lucene are only returning the default language nodeName (since in the index the variant nodeName would be nodeName_fr-fr etc. Do you know if the editor passes the relevant variant language to the data list items api or how this could be achieved so that the user will see the selected variants nodeName in the contentment list and picker? Many thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @bryanarcher, apologies for the delay in getting back to you. The quick answer is that no, it isn't possible to re-populate the data-source when the variant is changed/loaded. The longer answer is at the point when the Data List sources are populated, there is no reliable way to access the active variant/culture. Data List is a generic solution for populating list editors, it covers many typical use-cases, but for more specific scenarios, it can be simpler to go with a custom built property-editor, (rather than add edge-cases to Data List). Of course, this depends on developer resource, etc. |
Beta Was this translation helpful? Give feedback.
Hi @bryanarcher, apologies for the delay in getting back to you.
The quick answer is that no, it isn't possible to re-populate the data-source when the variant is changed/loaded.
The longer answer is at the point when the Data List sources are populated, there is no reliable way to access the active variant/culture.
For a more detailed technical explanation, see here: #76 (comment)
Data List is a generic solution for populating list editors, it covers many typical use-cases, but for more specific scenarios, it can be simpler to go with a custom built property-editor, (rather than add edge-cases to Data List). Of course, this depends on developer resource, etc.