Search by

uams-web / aether-blueprint-labels

joshdaughertybpmore

Per-blueprint create labels for the Statamic Control Panel: the create-entry and create-term buttons show a label chosen by the blueprint, without patching statamic/cms.

Package info

github.com/UAMS-Web/aether-blueprint-labels

Language:JavaScript

Type:statamic-addon

pkg:composer/uams-web/aether-blueprint-labels

Statistics

Installs: 1 004

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 5


README

A Statamic add-on that shows a label chosen by the blueprint on the Control Panel's create-entry and create-term buttons, without patching statamic/cms.

It is the interim home for two behaviors that UAMS-Web/patches-statamic-cms carries as patches while they are offered upstream, so a site can drop the patches before a statamic/cms release carries the behavior. Both labels are built: the create-entry label for collections and the create-term label for taxonomies.

Requirements

  • PHP 8.4 or later
  • Statamic 6.35 or later

Installation

composer require uams-web/aether-blueprint-labels

The floors are under Requirements. Statamic discovers the add-on through extra.statamic and the service provider through extra.laravel.providers in composer.json; there is nothing to register by hand. The add-on has no settings, so it publishes no configuration file.

Create-entry labels

A collection's create-entry label reads messages.<collection>_collection_create_entry.<blueprint> for the blueprint the Control Panel passes in the blueprint query parameter, then messages.<collection>_collection_create_entry, then Create Entry. Write the keys as flat keys in lang/en/messages.php:

return [
    'pages_collection_create_entry' => 'Create Page',
    'pages_collection_create_entry.news' => 'Create News Article',
];

The wiki's Reference lists the cases.

Create-term labels

A taxonomy's create-term label works the same way, with messages.<taxonomy>_taxonomy_create_term.<blueprint>, then messages.<taxonomy>_taxonomy_create_term, then Create Term:

return [
    'tags_taxonomy_create_term' => 'Create Tag',
    'tags_taxonomy_create_term.topic' => 'Create Topic Tag',
];

Documentation

  • Development guide: exercising the add-on in a Statamic host, and running the host-bound tests.
  • Submission checklist: the Packagist and Marketplace steps.
  • Decision log: why the repository is the way it is, with the alternatives that lost.
  • The wiki, published from docs/wiki/ when a release is published, and by hand.

Contributions follow CONTRIBUTING.md. The add-on's license is MIT. See LICENSE.