Problem/Motivation

This is a follow-up from #2862458: [META] Once media is enabled, having the File, Image and Media reference fields all listed is confusing.
On that issue, we allowed plugin descriptions defined in field type annotations to be shown on the UI.

We need to make sure that all descriptions currently present in the annotations make sense for the "average site builder", once they are now going to be exposed through the UI.

The following table indicates the current field descriptions from the annotations, and the proposed new texts:

Field Current Description Proposed Description
boolean An entity field containing a boolean value. Use a 'Boolean' field for a value with two options: 'On' or 'Off', True or False, 1 or 0.
comment This field manages configuration and presentation of comments on an entity. Use a 'Comments' field to enable comments. You will be able to configure comments in the field configuration.
datetime Create and store date values. Use a 'Date' field for a date or a date and time.
email An entity field containing an email value. Use an 'Email' field for an email address.
timestamp An entity field containing a UNIX timestamp value. Use a 'Timestamp' field for a date and time stored as a UNIX timestamp.
link Stores a URL string, optional varchar link text, and optional blob of attributes to assemble a link. Use a 'Link' field for a URL. It can also store the link text.
list_float This field stores float values from a list of allowed 'value => label' pairs, i.e. 'Fraction': 0 => 0, .25 => 1/4, .75 => 3/4, 1 => 1. Use a 'List (float)' field for float values from a fixed list of 'value => label' pairs. For example, the Fraction field could allow 0 => '0', .25 => '1/4', .75 => '3/4', 1 => '1'.
list_integer This field stores integer values from a list of allowed 'value => label' pairs, i.e. 'Lifetime in days': 1 => 1 day, 7 => 1 week, 31 => 1 month. Use a 'List (integer)' field for integer values from a fixed list of 'value => label' pairs. For example, the Lifetime field could allow 1 => '1 day', 7 => '1 week', 31 => '1 month'.
decimal This field stores a number in the database in a fixed decimal format. Use a 'Number (decimal)' field for a number with a fixed number of decimal digits.
float This field stores a number in the database in a floating point format. Use a 'Number (float)' field for a floating-point number.
integer This field stores a number in the database as an integer. Use a 'Number (integer)' field for an integer.
field_ui:entity_reference:node An entity field containing an entity reference. Use a 'Content' field for a reference to related content (or node).
entity_reference An entity field containing an entity reference. Use a generic 'Reference' field for references to other entities. This includes content entities, such as comments and custom blocks, as well as configuration entitites, such as date formats and views.
file N/A (modified in #2862458) Use a 'File' reference when you want to upload an arbitrary file to an entity, generally without re-usability needs. If in doubt, 'Media' references should be preferred instead. (after #2862458)
image N/A (modified in #2862458) Use an 'Image' reference when you want to upload an image to on entity, generally without re-usability needs. If in doubt, 'Media' references should be preferred instead. (after #2862458)
field_ui:entity_reference:media N/A (modified in #2862458) Use a "Media" field to reference assets such as files, images, videos and more. You will be able to select which media types can be referenced in the next steps. (after #2862458)
field_ui:entity_reference:taxonomy_term An entity field containing an entity reference. Use a 'Taxonomy term' field to reference a term from one or more vocabulary.
field_ui:entity_reference:user An entity field containing an entity reference. Use a 'User' field to reference a Drupal user account.
list_string This field stores text values from a list of allowed 'value => label' pairs, i.e. 'US States': IL => Illinois, IA => Iowa, IN => Indiana. Use a 'List (text)' field for a string value from a fixed list of 'value => label' pairs. For example, the 'US State' field could allow 'IL' => 'Illinois', 'IA' => 'Iowa', 'IN' => 'Indiana'.
text This field stores a text with a text format. Use a 'Text (formatted)' field to store short text that allows rich-text formatting (HTML).
text_long This field stores a long text with a text format. Use a 'Text (formatted, long)' field to store long text that allows rich-text formatting (HTML).
text_with_summary This field stores long text with a format and an optional summary. Use a 'Text (formatted, long, with summary)' field to store long text, and an optional summary, that allow rich-text formatting (HTML). This is used for the Body field of the standard Article and Page content types.
string A field containing a plain string value. Use a 'Text (plain)' field for short, unformatted text. You must configure the maximum length for this field.
string_long A field containing a long string value. Use a 'Text (plain, long)' field for long, unformatted text.

Proposed resolution

Review the wording of all existing descriptions to make sure they are understandable by the site builder.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

marcoscano created an issue. See original summary.

marcoscano’s picture

Title: Improve field description texts for fields provided by core » [PP-1] Improve field description texts for fields provided by core
Issue summary: View changes
Status: Active » Postponed
Issue tags: +Needs usability review
marcoscano’s picture

As pointed out in #2862458-74: [META] Once media is enabled, having the File, Image and Media reference fields all listed is confusing, there's nothing preventing us from advancing the discussion about the texts here, to have them ready and just waiting the right time to be committed.

Once the implementation of this is less important than the texts themselves, I suggest we try to reach consensus on the strings, and then write a patch with them.

Even if I'm probably not the most qualified for it :), here's a first shot aiming to improve what we currently have:

Field Current Description Proposed Description
boolean An entity field containing a boolean value. Stores boolean values, such as "On/Off", "True/False",
etc.
comment This field manages configuration and presentation of comments on an entity. Manages configuration and presentation of comments on an entity.
datetime Create and store date values. Stores date values.
email An entity field containing an email value. Stores a string value in the format of a valid email address.
timestamp An entity field containing a UNIX timestamp value. Stores a date field in the format of a UNIX timestamp.
link Stores a URL string, optional varchar link text, and optional blob of attributes to assemble a link. Stores a URL string, optional varchar link text, and optional blob of attributes to assemble a link.
list_float This field stores float values from a list of allowed 'value => label' pairs, i.e. 'Fraction': 0 => 0, .25 => 1/4, .75 => 3/4, 1 => 1. Stores float values from a list of allowed 'value => label' pairs, i.e. 'Fraction': 0 => 0, .25 => 1/4, .75 => 3/4, 1 => 1.
list_integer This field stores integer values from a list of allowed 'value => label' pairs, i.e. 'Lifetime in days': 1 => 1 day, 7 => 1 week, 31 => 1 month. Stores integer values from a list of allowed 'value => label' pairs, i.e. 'Lifetime in days': 1 => 1 day, 7 => 1 week, 31 => 1 month.
decimal This field stores a number in the database in a fixed decimal format. Stores a number in the database in a fixed decimal format.
float This field stores a number in the database in a floating point format. Stores a number in the database in a floating point format.
integer This field stores a number in the database as an integer. Stores a number in the database as an integer.
field_ui:entity_reference :node An entity field containing an entity reference. Stores the ID of a related node.
Use this field when you want to relate two nodes together. For example, in a "Related articles" context.
entity_reference An entity field containing an entity reference. A generic entity reference field to relate two entities.
file N/A (modified in #2862458)
image N/A (modified in #2862458)
field_ui:entity_reference :media N/A (modified in #2862458)
field_ui:entity_reference :taxonomy_term An entity field containing an entity reference. Stores the ID of a Taxonomy Term related to the entity this field is attached to.
field_ui:entity_reference :user An entity field containing an entity reference. Stores the ID of the user related to the entity this field is attached to.
list_string This field stores text values from a list of allowed 'value => label' pairs, i.e. 'US States': IL => Illinois, IA => Iowa, IN => Indiana. Stores text values from a list of allowed 'value => label' pairs, i.e. 'US States': IL => Illinois, IA => Iowa, IN => Indiana.
text This field stores a text with a text format. Stores a text that allows rich-text formatting (HTML).
text_long This field stores a long text with a text format. Stores a long text that allows rich-text formatting (HTML).
text_with_summary This field stores long text with a format and an optional summary. Stores a long text that allows rich-text formatting (HTML). Additionally, a "Summary" field can be used to store a reduced version of the text.
string A field containing a plain string value. Stores a plain string text value, suited for short strings (max XX chars).
string_long A field containing a long string value. Stores a plain string text value that can be up to XX chars long.

It's hard not to get into technical details for some of them, because strictly speaking, the user is choosing the storage of the field on this screen, so even if not very explicit, they are making a technical decision in the end.
This makes me wonder if we shouldn't further improve this same screen (once there's so much white space... :) with something that would explain how fields in Drupal are created/configured? Something like

The process of creating a field consists of 3 steps: 1) On this page you will choose the field type (i.e. how it will be stored in the DB), and then optionally you can 2) go to the "form display configuration" to define how users will input data into it (i.e. choose a widget), and 2) go to the "display configuration" to define how the entered values will be displayed to end users (i.e. choose a formatter)

but I guess this is probably material for another different issue...

Berdir’s picture

Random thoughts, I suggest you wait for more feedback before doing anything:

* boolean: not sure if we need mutliple examples or even "e.g.", maybe one is enough to keep it simpler?
* comment: while technically we only store settings in the comment field, for the user, it actually enables having comments, so it should probably have more focus on that.
* datetime: Possibly explicitly mention "date and time (optional)" or so?
* timestamp: "Stores a date field" <-- no "field", we just store a date, not a "date field" :)
* link: stuff about blob is too technical. Maybe leave out attributes completely because core does not actually provide a widget to manage link attributes? Also no need for "varchar title", just title is enough.
* decimal (and others): No need for "in the database" and similar things. Might not actually be correct (contact forms don't store anywhere by default), not relevant and all fields store something in the database if the entity is saved.
* entity_reference: a field with multiple values connects more than just two entities together, maybe just References another entity or something like that, without explicit "two".
* entity reference:*: IMHO I wouldn't talk about an ID there, just a reference, it doesn't matter to the user how it is explicitly stored internally?
* string_long: string_long can be *really* long, so I wouldn't mention an explicit limit. There is also no UI in core to configure a limit.

Help text: yeah, I'd suggest different issue and I know that the UX team wants to revamp the whole thing, so wouldn't invest too much time there. On the other side, those ideas/plans have existed for years and we haven't seen much yet (in core).

Berdir’s picture

I would also suggest to keep the list of suggestions (only) in the summary, then everyone can edit it and we can update it, maybe just mention changes then in the comment.

marcoscano’s picture

Component: field_ui.module » user interface text
Issue summary: View changes

That makes sense, thanks!

I've moved the table proposed in #3 to the IS, so next tweaks can be followed by checking the diffs.

marcoscano’s picture

Issue summary: View changes

And now I've included as well some of the feedback from #4.

Thanks!

yoroy’s picture

Thanks for listing all the strings @marcoscano.

As I started reviewing and rewriting, I noticed we need to make an explicit decision about the perspective from which these strings are written:

Should we describe the item’s behaviour or describe the user goal/result? Examples:

“Stores a number as an integer” or “Store integer numbers”

“Stores a date value in the format of a UNIX timestamp” or “Store dates as UNIX timestamps”. We use the former pattern on the modules page so we could choose to be consistent with that. I personally don't really like it because it reads more like passive documentation where the latter subtly guides me along, talks to me about what I want to achieve.

Also:

- I think we can do without the "in the format of" bits that are used here and there
- For the references: do we want to be explicit about "one or more" things you can reference?
- This was already the case but: In the list_* descriptions I’m confused about how the single quotes are used in the first general pattern example vs. the examples that follow. The quotes are around the full pattern initially, then in the examples only around the initial label?

Ran out of time to update the strings in the issue summary table so excuse the quick dump here. I'm still mixing perspectives here, so use this to get a feel for how both approaches differ and then lets choose one:

Stores boolean values, such as "On/Off".
Add this field to allow comments on the entity.
Store date and time values.
Store a valid email address.
Store a date as a UNIX timestamp.
Stores a URL string with an optional link text to create a link.
.
.
Store a number in a fixed decimal format.
Stores a number in a floating point format.
Stores a number as an integer.
Stores a reference to a content item. Use this field when you want to relate content. For example, in a "Related articles" context.
A generic entity reference field to relate entities together.
.
.
.
References a taxonomy term related to the entity this field is attached to.
Creates a reference to a user.
Stores text values from a list of allowed 'value => label' pairs, i.e. 'US States': IL => Illinois, IA => Iowa, IN => Indiana.
Stores a text that allows rich-text formatting (HTML).
Stores a long text that allows rich-text formatting (HTML).
Stores a long text that allows rich-text formatting (HTML). It also provided a "Summary" field to store a shorter version of the text.
Store a plain text string of max XX chars.
Store a long plain text string.

benjifisher’s picture

Issue summary: View changes

My initial thought was that getting rid of the "in the database" phrase was a step in the right direction, and that we should go for short phrases describing the values, cutting out the repetitive "stores" and "values".

Then I looked at the three descriptions in #2862458: [META] Once media is enabled, having the File, Image and Media reference fields all listed is confusing. (These are not listed in the issue description nor comments there, except for screenshots, so I extracted them from the patch.) Since those have already been discussed a bit, I decided to use them as a model: "Use a 'Foo' field to ...". I also include them in the issue description.

This goes against my initial thought to cut down on repeated phrases. On the other hand, I think it is much worse to call the field type one thing in the "Add a new field" select list and then call it something else in the description. Imagine the confusion if you select "Text (short)" from the select list, and the description refers to "string". Yes, that's what I want, but I do not see "string" as an option!

I am replacing the table in the issue description with my own version. I have not made any changes based on @yoroy's comment above. I think I address at least one of the points there, being more consistent about using quote in the list_* field types.

P.S. I am not happy with my description of the decimal field: "Use a 'Number (decimal)' field for a number with a fixed number of decimal digits." Can we avoid using the word "number" twice?

joachim’s picture

> Since those have already been discussed a bit, I decided to use them as a model: "Use a 'Foo' field to ...". I also include them in the issue description.

The problem with starting all the field description texts with 'Use a...' is that they then only make sense when creating a field. You can't, for example, display them somewhere on an existing field.

marcoscano’s picture

The problem with starting all the field description texts with 'Use a...' is that they then only make sense when creating a field. You can't, for example, display them somewhere on an existing field.

Up until now these descriptions weren't being used anywhere, so an argument could be made that a need to display them somewhere else is quite remote. IMHO, it would be preferable to have a good description that works well for this page, and when (and if) the need appears to show them somewhere else, we can decide how to deal with that. I think this would be better than trying to find a generic-enough description that could work everywhere, but with limited (or not as good) result on this page.

joachim’s picture

> IMHO, it would be preferable to have a good description that works well for this page, and when (and if) the need appears to show them somewhere else, we can decide how to deal with that.

If this were just in core, then sure, that would be a viable plan.

But what we do here sets the pattern for all field type plugins, in core and contrib. If we write them in this format, then contrib will follow suit. If then later on in the D8 cycle we find we want to show the descriptions in another context, we won't be able to.

benjifisher’s picture

@joachim, I think the right place for this discussion is the parent issue, #2862458: [META] Once media is enabled, having the File, Image and Media reference fields all listed is confusing. I will reply to your comment there.

ifrik’s picture

Thanks for putting all of these together in a list, and I agree with Roy that this is a decision about the question that we assume most users will have in their head. One is "What does this field do? Does it what I want?", the other is "Which of these fields do I choose to do xyz?"

Looking at both lists of proposed wording: Many of the them don't really give more information then the field label itself (for example, Email), but some give a bit more information. But some give additional information (for example that a comment field can be configured further, or that a boolean field can be used with different wording.) and this is more useful for the people that look it at it and wonder which one to choose. Also it's more the newer users who will be reading these texts, while at a later stage we don't need to look at the descriptions any more.
So I would go for the "Use for..." and "Use when...." descriptions, and I would even add a bit more to it then there is now where there is more option available then users might assume.

For example:

  • Boolean: Use for for a value with two options such as On/Off, True/False, 1/0 etc.
  • Text (plain): Use for short, unformatted text. You can configure the maximum length for this field.
  • Comments: Use to let users add comments.
  • Text with summary: Use for longer, formatted text with an optional summary.

An additional note: Formatted text is not necessarily "rich-text formatting (HTML)". Depending on the text editor used, it can be other types of formatting as well. This got discussed at length while writing the help text for the Editor module, so you can take some wording from there (/admin/help/editor)
And for list strings: Can we have a different example instead of US states? There's already enough US references build into Drupal :-) Maybe whole countries? AUS : Australia, AR | Argentina maybe?

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.

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.