In the node template, we want the node title to be output as follows:

  {{ title.prefix }}
  {% if not page %}
    <h2{{ title.attributes }}><a href="{{ url }}" rel="bookmark">{{ title.label }}</a></h2>
  {% endif %}
  {{ title.suffix }}

But changing the title prefix and suffix should be done globally, and will affect many other templates as well, thus this separate issue.


jenlampton’s picture

Title: Markup and variable cleanup for titles in all templates » Markup and variable cleanup for titles and attributes in all templates

This change also applies to attributes, content_attributes (should be content.attributes) and title_attributes (should be title.attributes)

Cottser’s picture

Priority: Major » Normal
Issue summary: View changes
Issue tags: +Twig

Changing to normal since there hasn't been much movement and we'd need to determine what would happen when {{ title }} is placed in the template. We talked about this on the Twig call and it seems like we'd need to introduce another theme function or template and we're trying to move away from very granular theme functions and templates.

mortendk’s picture

could we rename it {{ title.prefix }} & {{ title.suffix }} to something that makes sense ?
afaik it dosnt have anything to do with the title


{{ title.prefix }} -> {{ contextual_links }} 

{{ title.suffix }} -> {{ containerforstuff }}
lauriii’s picture

Version: 8.0.x-dev » 9.x-dev
Component: theme system » Classy theme
Status: Active » Postponed

This sounds a bit Classy issue. However this is something we can't do anymore for Drupal 8.

catch’s picture

Version: 9.x-dev » 8.3.x-dev
Status: Postponed » Active

Spoke to Cottser about this and it might be doable in a minor release with bc, so moving back down.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.