Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Static Label

No security coverage
View on drupal.org

This module allows you to manage static labels as key-value pairs within Drupal, ideal for headless applications. It enables frontend teams to update text content, such as form labels or error messages, directly within Drupal, with optional REST API support for easy frontend consumption. This avoids hardcoding text in frontend code and leverages Drupal's translation capabilities.

Overview

The Static Label module (machine name: static_label) provides a custom content entity to manage static labels as key → value pairs in Drupal.

It is designed especially for headless and decoupled architectures, where frontend applications (such as React, Angular, Flutter, etc.) need configurable, multilingual static text that can be managed centrally in Drupal and exposed via an API.

This allows frontend teams to update labels without changing frontend code, while fully leveraging Drupal’s content and translation capabilities.

The module also includes an optional REST API submodule (static_label_rest_api) to expose these labels programmatically.

Module Structure

  • static_label
  • Base module that defines the Static Label entity and UI.

  • static_label_rest_api
  • Submodule that exposes Static Labels via a REST endpoint.

Key Features

  • Manage key → value static labels
  • Supports multilingual translations
  • Drupal admin UI for CRUD operations
  • Designed for headless / decoupled frontends
  • Optional REST API for frontend consumption

Use Cases

  • Centralized management of frontend UI labels
  • Error messages, form labels, helper texts
  • Multilingual frontend applications
  • Avoid hardcoding labels in frontend code
  • Reuse the same labels across web and mobile apps

Manage Static Labels

After enabling the base module:

  1. Navigate to
  2. Content → Static Labels
    (/admin/content/static-labels)

  3. You can:
  • Add new static labels
  • Edit or delete existing labels
  • Translate labels (if multilingual is enabled)

Enable Multilingual Support

To enable translations for Static Labels:

  1. Go to
  2. /admin/config/regional/content-language

  3. Enable translations for the Static Label entity
  4. Configure the required languages

Example Usage

Create a Static Label

  1. Go to
  2. /admin/content/static-labels

  3. Click Add Static Label
  4. Enter:
  • Key (unique machine name, e.g. lbl_firstname)
  • Label (e.g. Enter the first name)
  • Save the label

REST API Submodule (static_label_rest_api)

Overview

The Static Label REST API submodule exposes static labels via a REST endpoint, making them easily consumable by frontend applications.

This submodule depends on:

  • static_label
  • rest
  • serialization

REST Endpoint
GET /api/v1/static-labels

Optional Query Parameters

Parameter
key - Fetch a specific label by machine name
lang - Language code (e.g. en, fr)

/api/v1/static-labels?key=lbl_firstname
/api/v1/static-labels?lang=ta

Sample API Output

{
  "meta": {
    "count": 3,
    "lang": "en"
  },
  "data": {
    "lbl_firstname": "Enter the first name",
    "lbl_password": "Enter the password",
    "err_msg_password": "Please enter the valid password!"
  }
}

REST Configuration

The REST resource configuration is automatically managed by the submodule.

  • Config is installed from config/install
  • Config is automatically removed on module uninstall
  • No manual cleanup required

Frontend Usage (Headless CMS)

In a headless Drupal setup, frontend applications can fetch static labels from Drupal and render them dynamically.

Benefits

  • Update labels anytime from Drupal
  • No frontend redeployment required
  • Multilingual support out of the box
  • Consistent content across platforms

Supported Frontends

  • React
  • Angular
  • Flutter , etc
  • Any framework capable of consuming JSON APIs

Installation

Troubleshooting

  • Clear caches after installing or updating modules
  • Ensure multilingual settings are enabled for translations
  • Ensure REST and serialization modules are enabled when using the API
  • Verify REST resource configuration at
  • /admin/config/services/rest

Maintainer

Mamallan A
https://www.drupal.org/u/mamallana

Support

For bug reports, feature requests, and general support, use the issue queue:

👉 https://www.drupal.org/project/issues/static_label

Activity

Total releases
1
First release
Feb 2026
Latest release
5 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Feb 6, 2026