Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5


Overview

In some rare cases, it is needed to override part of the data that is associated to the search results. For these case there is a custom labels mapping structure that enhances the data.

Goal

This document provides insight on React powered custom mappings feature.

Prerequisite

Configured Hawksearch results widget using the React template

Configuring 'Hawksearch results' Widget

Enable React for Hawksearch results widget

Facets localization

The label mappings are realized the same way as the translations. An array with the label values is positioned in each of the widget templates. In this case however, the array should be extended with any values that are specific to the indexed data. The most common case is mapping the Sitefinity content type value to a human readable label in the facets and selections header.

<script data-translations="react-mappings" type="application/json">
    {
        "Telerik.Sitefinity.Events.Model.Event": "@Html.HtmlSanitize(Html.Resource("EventTypeDisplayName", "HawkWidgetsResources"))",
        "Telerik.Sitefinity.Libraries.Model.Image": "@Html.HtmlSanitize(Html.Resource("ImageTypeDisplayName", "HawkWidgetsResources"))",
        "Telerik.Sitefinity.Libraries.Model.Video": "@Html.HtmlSanitize(Html.Resource("VideoTypeDisplayName", "HawkWidgetsResources"))",
        ...
    }
</script>

The inclusion of this array is required for enabling custom label mapping. Removing it will prevent the system to modify any of the labels. Though it is not mandatory, it is not recommended to remove it from the widget template.



  • No labels