This issue is spun off from #2831274-390: Bring Media entity module to core as Media module. Specifically, this point of review:

Remove full view mode and "tricky" template title handling. There are many valid usecases for this, but it doesn't necessarily need to be in core.

We (the Media team) tried to do this over in #2877346: Media Entity finalish review (disregard if you're not part of the Media Initiative; working around long issue node) but failed because core tests (not just Media tests) broke. @Wim Leers quickly identified the reason in #2877346-25: Media Entity finalish review (disregard if you're not part of the Media Initiative; working around long issue node). Ultimately, we decided to just continue doing what Taxonomy is doing for term entities, which is send a boolean variable into the term template (or use similar logic in the template itself) to indicate whether or not we are in a "full-page" view of the term. Node does something similar, as does Media. Three entity types in core, all solving the same weird problem in essentially the same way. Hmmm!

This problem should be solved generically in core.

Remaining Tasks

  • Let's open the ol' bike shed and figure out the best way to solve this.
  • Then let's do that in patch form.
  • And re-open the bike shed until the patch resembles Perfection Itself.
  • At which point we'll bat our eyes expectantly at the committers...
  • ...which will inspire them to land the patch!

Comments

phenaproxima created an issue. See original summary.

seanb’s picture

Added back the full view mode in the main media patch. Discussed this with phenaproxima on IRC. The main reasons:

  • Since media has a detail page, it makes sense to use a full view mode for that. As WimLeers pointed out, \Drupal\Core\Entity\EntityViewBuilder::view() uses 'full' view mode as a default. We could try to work around that, but that doesn't seem to make sense.
  • Taxonomy has a full view mode is well, referencing media could be viewed as a similar type of reference.
phenaproxima’s picture

Title: Add a "full" view mode for media items » Find a way to make title handling generic in entity templates
Issue summary: View changes

Re-titling and re-summarizing.

phenaproxima’s picture

Issue summary: View changes

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

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

phenaproxima’s picture

Status: Postponed » Active

#2831274: Bring Media entity module to core as Media module landed aeons ago, so it's time to re-open this.

Version: 8.5.x-dev » 8.6.x-dev

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

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jonathanshaw’s picture

The node currently does this endangers kittens. There's a lot of tricky BC issues in trying to fix it.

adamps’s picture

Status: Active » Closed (outdated)
Parent issue: » #2353867: [META] Expose Title and other base fields in Manage Display

As far as I can see the code this issue refers to (see below) was removed in #2930788: Do not show name by default in media displays

  {#
    In the 'full' view mode the entity label is assumed to be displayed as the
    page title, so we do not display it here.
  #}
  {{ title_prefix }}
  {% if label and view_mode != 'full' %}
    <h2{{ title_attributes }}>
      {{ label }}
    </h2>
  {% endif %}
  {{ title_suffix }}

The code remains for node and taxonomy. However it is code that only applies if the title is not present in Manage display - and so would inevitably be removed if core moves to use manage display.

Hence I propose that this issue is outdated. Of course please reopen if you don't agree.