Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

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

Features

  • 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.

Examples

Relabel content types by their machine name

r|article|Awesome articles
r|event|Events
r|another_content_type|Others

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

Caveats

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.

Requirements

  • 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

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0-rc3 Pre-release Dec 30, 2024
8.x-1.5 Stable Dec 30, 2024