Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
user-picture.html.twig has been removed from core (see https://drupal.org/node/1851200)
We need to update the docblocks that reference this template file (in both modules/node/templates/node.html.twig and themes/bartik/templates/node.html.twig)
Currently:
* - user_picture: The node author's picture from user-picture.html.twig.
Needs to be:
* - user_picture: The node author's information as loaded from the 'compact' view mode for the user entity.
Comment | File | Size | Author |
---|---|---|---|
#18 | 1912536-remove-references-18.patch | 1.52 KB | vollepeer |
Comments
Comment #1
taslett CreditAttribution: taslett commentedMaybe this should just be handled the same as all other images.
From image.html.twig:
Comment #2
steveoliver CreditAttribution: steveoliver commentedYep. Theme calls to 'user_picture' could be changed to 'image__user' to use the same image.html.twig and then, if we decide to keep a user image container in core, we can implement image--user.html.twig.
Comment #3
c4rl CreditAttribution: c4rl commentedI'm wondering how relevant this is as an individual theme function. Where are the instances in which user pictures appear? Three that come to mind are tops of nodes, tops of comments, and user profile pages. As acknowledged by steveoliver, these are really just image fields, and so it seems to me would be themed as any other image field would be themed with the potential of named suggestions.
So, it seems reasonable to deprecate this as an individual theme function in favor of a `field` or `image` implementation.
Comment #4
mortendk CreditAttribution: mortendk commentedi dont see the user picture as an individual theme function tbh, they are "just" image fields. as long as its easy to grap in user data to the image we would be golden something like this in node.twig:
Comment #5
jwilson3Which user_picture are we taking about here? the one in the node template?
If you look at the preprocess, the user_picture variable in the node template is just rendering the 'compact' view mode of the author (which happens to produce a picture of the user).
Yesterday, in a discussion with Jen Lampton and FabianX at the bof yesterday afternoon as part of getting rid of preprocess hook --> #1982018: [meta] Refactor template_preprocess(), we came up with the idea that we could abandon {{ user_picture }} altogether, and just use
{{ author }}
which would, by default render the 'compact' view mode, including user picture, then themer's could alter this with syntax that would look something like{{ author|view_mode('another_custom_view_mode')
if they so wished. Themer's would also be able to get at additional internal information about the author such as{{ author.name }}
for use, in other parts of the template.Comment #6
star-szrMoving to core queue for further discussion.
Comment #7
jenlamptonUpdating the issue summary to reflect the requested change in markup (and how to achieve). We should create a follow-up issue to add the filter for view modes on entities. Can someone do that for us please?
Comment #7.0
jenlamptonMeta issue added.
Comment #8
jenlamptontagging
Comment #9
derheap CreditAttribution: derheap commentedComment #10
jenlamptonWhat we need to do is update the docblocks that reference this template file (in both modules/node/templates/node.html.twig and themes/bartik/templates/node.html.twig)
Currently:
Needs to be:
Comment #10.0
jenlamptonupdate issue to match new decision.
Comment #10.1
jenlamptonupdate
Comment #11
derheap CreditAttribution: derheap commentedComment #11.0
derheap CreditAttribution: derheap commentedlink to change notice
Comment #12
jenlamptonLooks like the attached patch also includes changes to maintainers.txt.
Comment #13
vollepeer CreditAttribution: vollepeer commentedComment #14
vollepeer CreditAttribution: vollepeer commentedRecreated the patch without modifications to CHANGELOG.txt.
Comment #16
vollepeer CreditAttribution: vollepeer commentedCorrected the patch from #14.
Comment #17
Wim LeersStupid, but… this needs to wrap at 80 cols :) Just one more reroll! :)
Comment #18
vollepeer CreditAttribution: vollepeer commentedWrapped to 80 cols.
Comment #19
Wim LeersThanks!
Comment #22
webchickLooks like this was committed.