Change block "label" so thad a title like everything else in the template file (and all other template files)

Created on 11 March 2013, about 12 years ago
Updated 18 March 2025, 18 days ago

Problem/Motivation

Look at this code, it's an inconsistent mess of title_prefix, title_attributes and label!

<div{{ attributes }}>
  {{ title_prefix }}
  {% if label %}
    <h2{{ title_attributes }}>{{ label }}</h2>
  {% endif %}
  {{ title_suffix }}

  <div{{ content_attributes }}>
    {{ content }}
  </div>
</div>

Proposed resolution

The fix: The variables printed in a template file for a title of a block should to be called title.

User interface changes

- none

API changes

- none

Related Issues

#1591806: Change block "subject" so that it's called a (admin_)label like everything else on the theme layer β†’
#1591830: Change comment "subject" so that it's called a title like everything else in the template file (and all other template files) β†’
πŸ“Œ Name variables consistently across all templates (preprocess) Closed: outdated
πŸ“Œ Change node "label" so that it's called a title like everything else in the template file (and all other template files) Postponed: needs info

Beta phase evaluation

<!--Uncomment the relevant rows for the issue. -->
πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

block.module

Created by

πŸ‡ΊπŸ‡ΈUnited States jenlampton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Quoting myself from πŸ“Œ Change node "label" so that it's called a title like everything else in the template file (and all other template files) Postponed: needs info as it applies here too.

    This issue has gone stale for almost 10 years.

    I'm actually somewhat against this change, label is a consistent Drupalism applied to all entity types. Title is not. E.g in #1939224: Change block "label" so that it's called a title like everything else in the template file (and all other template files) blocks don't have a title, they have a block description or label.

    If anything, the title_prefix/suffix/attributes should be the ones to change?

  • πŸ‡¨πŸ‡¦Canada xmacinfo Canada

    Same comment here.

    To get more developers on Drupal, some "Drupalism" needs to go.

    Developers are typically giving a name to the things they create.

    - Name of the block
    - Name of the variable
    - Name of the function
    - Name of the field

    A label is a tag attached to an item.

    So either we continue putting Drupal in a corner with its "Drupalism" or we adopt more generalized standards.

Production build 0.71.5 2024