Developer forum

Forum » Ecommerce - Standard features » How to translate automatically generated facets from custom facetable index fields?

How to translate automatically generated facets from custom facetable index fields?

Davy Capiau
Reply

 

Hi,

We have a product attribute field, for example “Koppeling 1”, containing values such as 3/4"M.

When using the field generated by the ProductIndexSchemaExtender, the field is Analyzed. As a result, values such as 3/4"M are tokenized and the facet only shows 3.

To solve this, we created a custom index field using the same product field as source:

* Type: System.String
* Indexed: Yes
* Analyzed: No
* Facetable: Yes

 

This works correctly: the complete value 3/4"M is now shown as a single facet value.

Enabling Facetable on the custom index field also automatically makes the field available as a facet, so we don’t need to manually create an additional facet/query parameter/expression.

The remaining issue is localization of the facet name.

The original product attribute field can be translated, e.g.:

* NL: Koppeling
* EN: Connection
* FR: Raccord

However, the automatically generated facet seems to use the Name of the custom index field, and we cannot find a way to translate this name.

What is the recommended approach in DW10 to localize the display name of an automatically generated facet based on a custom Facetable index field?

Ideally, we would like to keep using the automatic faceting functionality while having the facet label follow the translation of the original product attribute field.

Is there a way to link the custom index field/facet back to the translated product field name, or should multilingual facets be configured in the additional facet/query parameter/expression way?

Thanks!

 


Replies

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply
This post has been marked as an answer

Hi Davy,

You're right: this isn't supported today. An automatic facet takes the index field's Name word for word, and nothing ever points it back to the translated product field. That also goes for the facet created by ProductIndexSchemaExtender for the original field.

For a long-term resolution, I suggest you put up a feature request - it makes perfect sense to have have it consider localization.

For a quick-fix the best I can think of is to translate the label in the template, for example @Translate(facet.Name), and add entries for the facet name (e.g. "Koppeling") in the translations for NL/EN/FR. That keeps automatic faceting working. 

Votes for this answer: 1

 

You must be logged in to post in the forum