-3

i have set a facet using a taxonomy ref field from an indexed search api view.

Using JS:

const searchParams = new URLSearchParams(window.location.search);
const facetSearch = searchParams.get('f[0]');

output the name of the facet and the tid

recherche_generale_thematique:286

How can i retrieve the label of the corresponding taxonomy ?

I need to display in front the search that is currently made

4
  • Configure the Facets module (is this the facets module?) to output the entity label instead of the ID.
    – Kevin
    Commented May 17 at 19:44
  • @Kevin talking about that option ? "Transform entity ID to label". This does not transform tid in label in the query parameters
    – Matoeil
    Commented May 21 at 13:02
  • It does if this comes through the Facets module and the option is set on the Facet configuration. Even in Facets REST module. This affects the value of what the user sees, not whats in the URL. The raw value will appear in the URL, or alternatively index the term name as the facet. The image on this module is using data right from Facets where you can see the term label. drupal.org/project/views_rest_serializer_extra
    – Kevin
    Commented May 21 at 13:47
  • i am using the facets module and i cannot see that. the facet button do display the label but not the query parameter
    – Matoeil
    Commented May 21 at 13:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.