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.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

taslett’s picture

Maybe this should just be handled the same as all other images.

From image.html.twig:

<img src="{{ attributes.src }}"{{ attributes }} />
steveoliver’s picture

Yep. 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.

c4rl’s picture

I'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.

mortendk’s picture

i 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:

<a href="{{ image.useruid}}" title="{{ username }}">
<img src="{{ attributes.src }}"{{ attributes }} />
<a>
jwilson3’s picture

Which 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.

star-szr’s picture

Project: » Drupal core
Version: » 8.x-dev
Component: Markup or variable cleanup (front-end branch) » markup
Assigned: taslett » Unassigned
Category: feature » task

Moving to core queue for further discussion.

jenlampton’s picture

Title: User picture markup » Remove user-picture theme function (wrapper div) and use theme hook suggestion image__user instead

Updating 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?

jenlampton’s picture

Issue summary: View changes

Meta issue added.

jenlampton’s picture

Issue tags: -dreammarkup +theme system cleanup, +Template consolidation

tagging

derheap’s picture

Assigned: Unassigned » derheap
jenlampton’s picture

Title: Remove user-picture theme function (wrapper div) and use theme hook suggestion image__user instead » Remove all references to the (removed) user-picture.html.twig file
Component: markup » theme system
Issue tags: -Template consolidation

What 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:

 * - 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.
jenlampton’s picture

Issue summary: View changes

update issue to match new decision.

jenlampton’s picture

Issue summary: View changes

update

derheap’s picture

Assigned: derheap » Unassigned
Status: Active » Needs review
FileSize
2.17 KB
derheap’s picture

Issue summary: View changes

link to change notice

jenlampton’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Novice

Looks like the attached patch also includes changes to maintainers.txt.

vollepeer’s picture

Assigned: Unassigned » vollepeer
vollepeer’s picture

Status: Needs work » Needs review
FileSize
2.03 KB

Recreated the patch without modifications to CHANGELOG.txt.

Status: Needs review » Needs work

The last submitted patch, 14: 1912536-remove-references-14.patch, failed testing.

vollepeer’s picture

Status: Needs work » Needs review
FileSize
1.51 KB

Corrected the patch from #14.

Wim Leers’s picture

Status: Needs review » Needs work

Stupid, but… this needs to wrap at 80 cols :) Just one more reroll! :)

vollepeer’s picture

Status: Needs work » Needs review
FileSize
1.52 KB

Wrapped to 80 cols.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

The last submitted patch, 16: 1912536-remove-references-16.patch, failed testing.

  • Commit bd6c123 on 8.x by alexpott:
    Issue #1912536 by vollepeer, derheap | taslett: Remove all references to...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Looks like this was committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.