Change node "label" so that it's called 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, 22 days ago

Problem/Motivation

Look at this code, this is an inconsistent mess:

 <?php print render($title_prefix); ?>
  <?php if (!$page): ?>
  <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>" rel="bookmark"><?php print $label; ?></a></h2>
  <?php endif; ?>
  <?php print render($title_suffix); ?> 

Proposed resolution

I understand the need to call the label() method on the node object instead of directly referencing the $node->title, but I don't understand why that needs to trickle all the way down to the theme layer. Can we please be consistent with our variable names and call this a title? We can preprocess it in, or do it as part of the Twig __to_string() method on rendering a node.title but in the template file we should really be calling this a title.

Alternatively, we could rename everything else in these templates that contains "title" into a label. label_prefix, label_suffix, label_attributes.

Remaining tasks

- make our templates consistent

User interface changes

- none

API changes

- none

Related Issues

#1939224: Change block "label" so that it's called a title like everything else in the template file (and all other template files) β†’
#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
πŸ“Œ Markup and variable cleanup for titles and attributes in all templates Active

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

node system

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.

Production build 0.71.5 2024