#2353867: [META] Expose Title and other base fields in Manage Display will introduce the "normal" mechanism for managing display of title and other base fields then deprecate the old specialist non-standard way. With the major release of D10 we should remove the deprecated code.
Changes required have @todo markers linking to this issue, and are summarised below.
Node template
- Remove
label,date,author_name- code can use elements[title] etc. - Remove
page,display_submitted- if title/submitted should not be displayed then the corresponding elements will be missing or generate no markup. - Remove
author_attributes,author_picture- instead the information will be part of the rendered formatter output of elements[uid]. - Remove all process code related to the variables removed from the node template, including
template_preprocess_nodeandrdf_preprocess_node.
Field templates
- Remove all copies of
field--node--title.html.twig,field--node--uid.html.twig,field--node--created.html.twig. - In
node_themeremovefield__node__XXX.
Once we are using field formatters for the base-field output we don't need these special cases.
Node type
Remove $display_submitted, displaySubmitted(), setDisplaySubmitted(), related form/schema. It is controlled through manage display UI settings instead.
Theme setting
Remove the theme setting features.node_user_picture. Instead this is controlled by a setting on the formatter for the uid field.
Comments
Comment #2
adamps commentedComment #3
jonathanshawComment #5
xjmMajor-only changes are 10.0.x at this point. However, we should do a proper deprecation in a minor release to support the continuous upgrade path from D9 to D10. Thanks!
Comment #6
adamps commentedComment #7
adamps commentedComment #8
andypostIs there a way to deprecate templates and preprocess variables? I see no in https://www.drupal.org/about/core/policies/core-change-policies/drupal-c...
Comment #9
adamps commentedChanged this issue to D10. There is now a separate issue for deprecation: #3176673: Deprecate non-standard display of title and other base fields as requested by @laurii in #2993647: Correctly determine when to display fields as inline.
In that issue @laurii stated that "We can use the Twig deprecated tag to deprecate templates..". For the variables we might have to do our best with comments.
I think there is a key point that allows us to do something unusual: we will deprecate all the ways in Core of using the templates/variables, hence we can reasonably remove them in the next major version.
Anyway I don't plan to worry about this one much at the moment as there are many other issues that need to be solved before it even becomes relevant.
Comment #10
johnpitcairn commentedComment #11
acbramley commentedCan this be broken up into smaller chunks at all? It seems like this has quite a huge scope to cover for a single issue.
Comment #12
adamps commentedThis issue is a deprecation issue that depends on about 5 other open issues in #2353867: [META] Expose Title and other base fields in Manage Display so the question is somewhat theoretical at the moment.
I guess the patch will be quite large, but basically just be a load of deletions of deprecated code. I see no reason why it couldn't be split into multiple issues if desired.