Problem/Motivation

In Views, the contextual filter "Has taxonomy term ID" has a configuration option "Load default filter from node page, that's good for related taxonomy blocks". This text is ambiguous and confusing.

Steps to reproduce

  1. Create or edit a view of content: for example, /admin/structure/views/view/content.
  2. Under Advanced, add a contextual filter. Select "Has taxonomy term ID".
  3. For "When the filter value is NOT in the URL", select "Provide default value".
  4. For "Type", select "Taxonomy term ID from URL".
  5. One of the options is "Load default filter from node page, that's good for related taxonomy blocks".

Proposed resolution

The patch in #9 changes the text to "Load default filter from term entity reference field(s) on node page".

Remaining tasks

User interface changes

Before

screenshot showing the modal form with the text described above

API changes

None

Data model changes

None

Release notes snippet

N/A

Original report by @enap

The wording for the contextual filter:

Content: Has taxonomy term ID :: Provide default value :: Taxonomy term ID from URL :: Load default filter from node page, that's good for related taxonomy blocks

..is quite confusing and should be expanded to inform users that the ALL fields of the node are checked for entity_reference fields referencing taxonomy terms.

/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php L119

      '#title' => $this->t('Load default filter from node page, that\'s good for related taxonomy blocks'),
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

enapthine created an issue. See original summary.

enap’s picture

Issue tags: +Needs UX review

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.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.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.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.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should 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.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should 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.

ultimike’s picture

"that's good for related taxonomy blocks" has bugged me for years. There's no other help text text like this in Drupal core, it needs to be improved.

dorficus’s picture

I got a little tired of looking at this text, so here's a patch. Cheers.

xjm’s picture

Version: 8.6.x-dev » 8.9.x-dev
Issue tags: -Suggested wording, -needs UX review +Needs usability review

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.

AaronMcHale’s picture

Status: Needs review » Needs work
Issue tags: -Needs usability review +Needs issue summary update, +Needs screenshots

We attempted to review this issue at #3307567: Drupal Usability Meeting 2022-09-09, that issue will have a link to the recording.

During the meeting, even after attempting a couple of different ways of using this option, we could not identify exactly what the impact is of selecting this option.

We need more information on what exactly this option does and what the impact of selecting it is, with examples or steps to reproduce in Core before we can properly review this issue and make recommendations on the wording.

Tagging for issue summary update and screenshots. We felt this issue could also use a more descriptive title.

Once this has been done, please re-add the Needs usability review tag, thanks you.

benjifisher’s picture

Issue summary: View changes
FileSize
86.75 KB

For the record, the attendees at today's usability meeting were @AaronMcHale, @DyanneNova, @rkoller, @shaal, @vitorbs, @worldlinemine, and me.

Before deciding what the wording should be, we need to understand in more detail what the option does.


When you tag an issue for usability review, please make it easy for the usability team to review the issue. Update the issue summary:

  • The "Proposed resolution" section should describe all the changes made in the issue.
  • The "User interface changes" should show the existing UI and the proposed UI.

I have already rewritten the issue summary using the standard template. I added steps to reproduce and a "before" screenshot. I will leave the issue tags that @AAronMcHale added, since the proposed resolution should be updated, and we should have another screenshot, when we have settled on the wording.

Most of the time, I prefer to have plain text in the "Proposed resolution" section and screenshots in the "User interface changes" section.

You can also attend the weekly usability meeting to present an issue.

benjifisher’s picture

Title: Suggested wording - Contextual Filter - Content: Has taxonomy term ID - Load default filter from node page - Ambiguous » Taxonomy contextual filter has confusing description
Issue summary: View changes
FileSize
125.06 KB
104.75 KB

I think there is a bigger usability problem than the description of the option.

It is likely, when selecting this option, that there is more than one taxonomy term to be matched. As the screenshot in the issue summary shows, there is a related "Multiple-value handling" option with two options:

  • Filter to items that share all terms
  • Filter to items that share any term

Looking at the code in Drupal\taxonomy\Plugin\views\argument_default\Tid, I see that the multiple term IDs are concatenated with ',' or '+' depending on the value of this option.

The problem is that the resulting string only makes sense if the option "Allow multiple values" is selected. By default, this option is not selected and it is hidden inside a collapsed details element at the bottom of the modal window:

screenshot showing the "Allow multiple values" option at the bottom of the modal window

Another related option, also off by default, is "Reduce duplicates".

vinaymahale’s picture

Issue tags: -Needs screenshots

Removing the "Needs screenshots" tag since screenshot(s) are attached in comment #17

benjifisher’s picture

The "Reduce duplicates" and "Allow multiple values" options that I mentioned in #18 apply for any contextual filter. The option we are discussing in this issue only appears when you provide a default value from taxonomy. So it does not make sense to rearrange the form and make the more generic options depend on the taxonomy option.

I think one thing we can do to address the "bigger usability problem" is to expand the description: point the user to the related options.

While we are at it, I think we should actually use a description, separate from the title (or label).

Here is a suggestion to get the discussion started:

  • Title: Load default filter from node page
  • Description: Use terms from all term reference fields on the node. If you select this option, then also consider the "Reduce duplicates" and "Allow multiple values" options on this form.

This suggestion keeps the phrase "node page" from the current text. It is not very accurate, but it is consistent with the alternative, "Load default filter from term page".

benjifisher’s picture

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

Usability review

We discussed this issue at #3308883: Drupal Usability Meeting 2022-09-16. That issue has a link to a recording of the meeting.

For the record, the attendees at today's usability meeting were @AaronMcHale, @BlackBamboo, @rkoller, @simohell, @worldlinemine, and me.

We agreed to expand the scope of this issue a little to include the text for the other option, currently "Load default filter from term page".

We also discussed other ways to improve the UX of the contextual filters form. These are out of scope for the current issue, but we may create separate issues for them. Perhaps there are already issues, and we just have to find them.

For example, the two options we are discussing are shown once the Type is set to "Taxonomy term ID from the URL" (progressive disclosure). It would make the form clearer if these options were grouped in a fieldset and grouped visually, perhaps with additional indentation. The same suggestion applies when selecting the second option, "Load default filter from node page".

Another option would be to replace the progressive-disclosure pattern with a "wizard" pattern: open a new modal window for the dependent options when the form is submitted.

Returning to the scope of this issue, we suggest the following wording. This is a tentative suggestion, and it needs review in the context of the entire form. We suggest changing the checkbox labels to

  • Use term ID from the term page
  • Use term IDs from all term reference fields on the node

and then add a description to the second option:

  • If you select this option, then also consider the "Reduce duplicates" and "Allow multiple values" options on this form.

I am updating the Version field to 10.1.x since the beta versions of 9.5.0 and 10.0.0 were released yesterday.

AaronMcHale’s picture

Another option would be to replace the progressive-disclosure pattern with a "wizard" pattern: open a new modal window for the dependent options when the form is submitted.

I have now created #3310254: Use a multi-step form for the Views UI Contextual Filters to illustrate the problem and potential solution.

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.

vinaymahale’s picture

Any update over here?