Facets Custom Label

Module Drupal Illustration Voir sur Drupal.org
Nb téléchargements : 858


  • Code
  • Documentation
  • Miscellaneous
  • User interface





permet de renommer les labels des filtres de recherche


Status : Published
Projects : Modules
Maintenance status : Actively maintained
Development status : Under active development
Supported Branches : 2.0., 8.x-1.
shield Stable releases for this project are covered by the security advisory policy.


Facets Custom Label module is a facet processor which lets you rename / relabel facets items.


  • Relabels facets by:
    • their raw value: machine name or content IDs,
    • their display value: content titles, term names.

2.0 new features

  • Label replacements are now interpreted as HTML, so you may now include markup.

Basic usage

  1. Enable the module.
  2. Enable the facet processor Facets custom label processor.
  3. On each line, insert a replacement value as the following:
    <origin>|<value>|<new label>
    • origin determines the type of value to convert:
      • use r to convert raw value,
      • use d to convert the display value.
    • value determines the value to convert.
    • new label determines the final display name.
  4. (optional) If you need translated labels, enable the Configuration Translation module and translate the facet configuration.

Please note this processor will convert facet names in a single pass. For each result, it will attempt to convert using the raw mapping first, then the display mapping if not matching. Values which are not converted are left unchanged.


Relabel content types by their machine name

r|article|Awesome articles

Relabel terms using a mix of ID and names

r|156|Label of term 156
r|1337|Label of term 1337
d|Dog|New label of dog


You should not use auto incremented numeric entity IDs (like term or node IDs) if you plan to have a deployment scenario where those IDs will not match between the instances. You better have to use their name / title or another technical field.


  • Drupal 8+, no planned port on Drupal 7.
  • Facets: known to work with 1.0.0-beta2.
  • Configuration translation: if you need translated labels.

Similar modules

Search API Value Mapping

You can achieve similar results by using Search API Value Mapping. Instead of altering the label on facet's end, you alter the index by using a Search API processor, which adds a field using another field value.

Facets Custom Label does not require a reindex to work.

Link: https://www.drupal.org/project/search_api_mapping

Toutes les informations proviennent du site drupal.org