Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292064

Change node "label" so that it's called a title like everything else in the template file (and all other template files)

$
0
0

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

#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)
#1825216: Name variables consistently across all templates (preprocess)
#2004966: Markup and variable cleanup for titles and attributes in all templates


Viewing all articles
Browse latest Browse all 292064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>