Now that we've cleaned up the API for 'view_modes' a little (previously 'build_mode'; see #664544), we should add descriptions to the view_modes provided by core.

This will allow another patch to utilize these descriptions (such as the one brewing in #553298).

I'm no copywriter, but I'll outline what needs copy here and if we decide on what the descriptions should say, I can certainly roll a patch that implements them.

Comments

te-brian’s picture

The view modes provided by core are:

Book
Mode: 'print'
Label: 'Print'
Description: ???

Comment Module
Mode: 'full'
Label: 'Full comment'
Description: ???

Node Module
Mode: 'full'
Label: 'Full node'
Description: ???

Mode: 'teaser'
Label: 'Teaser'
Description: ???

Mode: 'rss'
Label: 'RSS'
Description: ???

Mode: 'search_index'
Label: 'Search index'
Description: ???

Mode: 'search_result'
Label: 'Search result'
Description: ???

Taxonomy Module
Mode: 'full'
Label: 'Taxonomy term page'
Description: ???

User Module
Mode: 'full'
Label: 'User Account'
Description: ???

Let me know if I missed any. As we get descriptions I'll edit these and point to the comment that added it.

andypost’s picture

Subscribe, suppose it slightly depends on #553298: Redesign the 'Manage Display' screen

te-brian’s picture

The usefulness certainly does rely on a UI counterpart, but that doesn't mean there shouldn't be any.

andypost’s picture

Component: base system » field system
Status: Needs work » Fixed

View modes already have Label see comment_entity_info()

te-brian’s picture

While I'll admit this is probably no longer a priority for D7, the point of this issue was to add a description in addition to the already existing label. A label is, by definition, short and merely identifies the view mode. A new Drupal user would benefit from a more detailed description of what the view mode is, and where it is used.

For example: 'Search Index' vs. 'Search Result'. Armed with only that information how is a user to know in what cases each mode is used.

If others feel this is unnecessary, 'wont fix' is probably more appropriate than 'fixed'.

andypost’s picture

Category: task » feature
Status: Fixed » Active
Issue tags: +Needs usability review

I think it's possible to have a some kind of help about view mode, maybe this improve UX

Bojhan’s picture

I dont really think this adds much value, these descriptions seem only necessary when we have bad labels?

joachim’s picture

Version: 7.x-dev » 8.6.x-dev
Issue summary: View changes

> I dont really think this adds much value, these descriptions seem only necessary when we have bad labels?

This has the potential to really help site builders. You can't always convey everything in a label that's only going to be 2-3 words at most.

Site builders could add descriptions such as 'This is used when article nodes are shown in the premium listings pages', or 'This is used for the summary on the user's account page'.

This would also be really good for contrib.

For example, Commerce adds a *lot* of built-in view modes, and it's not always clear where they are used, leaving site builders risking exposing private data when they change what a view mode shows, because they don't know all of the places where it's used.

Eg:

- Product variation, 'Summary'. A description here could say: 'Used for showing the customer their products in the review step of checkout'.

joachim’s picture

It's also worth saying that this issue was originally opened in D7. View modes were not as easy to set up as they are now.

In D8 however, they are quick and easy to create, and a very useful tool for theming. That means that sites can easily rack up LARGE numbers of them. My current site, for example, has 61 view modes, 22 of which are for nodes.

Here's a selection of them:

core.entity_view_mode.node.banner_advert.yml
core.entity_view_mode.node.block_teaser.yml
core.entity_view_mode.node.colour_teaser.yml
core.entity_view_mode.node.cover_story.yml
core.entity_view_mode.node.details.yml
core.entity_view_mode.node.featured.yml
core.entity_view_mode.node.full.yml
core.entity_view_mode.node.full_with_teasers.yml
core.entity_view_mode.node.homepage_feature.yml
core.entity_view_mode.node.homepage_feature_small.yml
core.entity_view_mode.node.listing.yml
core.entity_view_mode.node.listing_square_images.yml
core.entity_view_mode.node.rss.yml
core.entity_view_mode.node.search_index.yml
core.entity_view_mode.node.search_result.yml
core.entity_view_mode.node.sidebar_teaser.yml
core.entity_view_mode.node.teaser.yml
core.entity_view_mode.node.timeline.yml
core.entity_view_mode.node.token.yml
core.entity_view_mode.node.views_output.yml

It would be hugely useful to site buiders, themers, and developers if a view mode such as 'featured' could have a description text that explains where it is used in the site, and its general principle. E.g. "This shows a brief preview of the node with teaser text and a small image. It's use on the foo page, the user content page, ..." That would help to understand the consequences of making changes to it. It's very easy to make changes to a view mode because you want to change one particular part of the site, but not realize that that also affects other parts of the site where the view mode is used, which you had no idea existed!

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.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.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.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Status: Active » Closed (duplicate)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.