Name variables consistently across all templates (preprocess)

Created on 28 October 2012, about 12 years ago
Updated 5 July 2023, over 1 year ago

Problem/Motivation

It's frustrating to have to print a title three different ways in three different templates. In node, we use label, in comment we use title and in blocks we use subject. Here are some variables that should have the same name in all template files.

  • title != label != subject
  • name != author
  • date != created

Even worse, in node and comment templates where the "Submitted by" information appears to be in exactly the same format once rendered on the page, those templates actually use completely different variables to create the output. If you change it in one place, and then go to change it in the other, your copy/paste from one template to the next will fail. Let's make it work instead.

Proposed resolution

We need to name these things consistently across all of drupal if we want people to feel at home here.

Remaining tasks

Rename bocks: #1591806: Change block "subject" so that it's called a (admin_)label like everything else on the theme layer
Rename comments: #1591830: Change comment "subject" so that it's called a title like everything else in the template file (and all other template files)
Decide what to do with node templates [#]

User interface changes

TBD.

API changes

TBD.

Related Issues

📌 Markup and variable cleanup for titles and attributes in all templates Active

📌 Task
Status

Closed: outdated

Version

8.0 ⚰️

Component
Theme 

Last updated 1 day ago

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.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I am moving this issue back to Drupal core from the (now deleted) sandbox project used for the development of the theme engine that uses Twig.
    I am also marking it as obsolete; feel free to re-open it if necessary.

    I apologize for bumping this issue.

Production build 0.71.5 2024