Views interface - change "Show: Content" to "Show: Content view mode"

Created on 30 August 2021, almost 3 years ago
Updated 24 May 2023, about 1 year ago

It's bugged me for a long time that in the "Format" section of the views interface, we don't use the term "view mode" when selecting between "Content", "Fields, "Search results" and other options. The word "Content" seems a bit nebulous to me.

It seems that this could be greatly improved just by adding the phrase "view mode" after the word "Content". Similarly, for other base tables, "User view mode", "Term view mode", etc...

Discussion started here: https://twitter.com/ultimike/status/1431938522701877248?s=21

-mike

✨ Feature request
Status

Needs work

Version

11.0 🔥

Component
Views  →

Last updated less than a minute ago

Created by

🇺🇸United States ultimike Florida, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot → tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.

  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States ultimike Florida, USA

    Patch re-roll 😀

    -mike

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States mherchel Gainesville, FL, US

    Getting some CS errors:

     98 | WARNING | t() calls should be avoided in classes, use
        |         | \Drupal\Core\StringTranslation\StringTranslationTrait
        |         | and $this->t() instead
        |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
     
    +++ b/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php
    @@ -95,7 +95,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
    +          'title' => t('@label view mode', ['@label' => $entity_type->getLabel()]),
    

    Looks like you should be using $this->t() here.

  • 🇮🇳India _utsavsharma

    Applied #19 on #18.
    Please review.

  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States mherchel Gainesville, FL, US
  • 🇮🇳India Rinku Jacob 13 Kerala

    Applied patch #20 on drupal version 10.1.x. It was successful ly applied and i got the solution. Adding screenshots for the reference.Need RTBC+1.

  • Status changed to Needs work over 1 year ago
  • 🇳🇱Netherlands Lendude Amsterdam

    Hmmm coming back to this, I'm changing my mind about #8, the changed ordering of the items. It's not that I mind too much that 'Fields' is no longer the top one, I mind that the ordering in the screenshot doesn't make any sense, i.e. it seems unordered. Maybe the ordering was only correct by accident before, but this change still breaks that.
    So I think we need to make sure that we keep something like an alphabetical order I think (which for core would put Fields back on top).

  • 🇺🇸United States ultimike Florida, USA

    @lendude - thanks for the feedback, but unless I'm misunderstanding, the options are sorted alphabetically by Views::fetchPluginNames() - there's an asort() in there...

    When configuring the "Show" for a View based on nodes, "Content view mode" is alphabetically first. Am I misunderstanding something?

    -mike

  • 🇳🇱Netherlands Lendude Amsterdam

    @ultimike yeah for content it happens to look ok, but if you make a 'Media' view, it doesn't.

    The ordering is indeed done by plugin, but by plugin machine name, which for all these entities is 'entity:what_ever_the_entity_id_is'. So they are always ordered by the letter 'e'.

Production build 0.69.0 2024