The Drupal\views\Plugin\views\style\StylePluginBase class has the "rendered_strip" option with the label "Remove tags from rendered output". There are situations where its effect isn't strictly clear, so it would be useful to add a field description that explains it more clearly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
870 bytes

For consideration, this adds a description:

          $form['grouping'][$i]['rendered_strip'] = [
            '#type' => 'checkbox',
            '#title' => $this->t('Remove tags from rendered output'),
            '#description' => $this->t('Some modules add HTML to the rendered output and prevent the rows from grouping correctly. Stripping the HTML tags should correct this.'),
            '#default_value' => $grouping['rendered_strip'],
            '#states' => [
              'invisible' => [
                ':input[name="style_options[grouping][' . $i . '][field]"]' => ['value' => ''],
              ],
            ],
          ];

This has been added to Views on D7 (#1684990: Multiple Grouping not working), it'd be good to keep these two in sync.

DamienMcKenna’s picture

FYI the text was suggested by Bensbury.

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

Yeah that really benefits from an additional explanation, nice.

yoroy’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Usability

A before/after screenshot would be useful, where is this in the UI?

I think the current description is overly wordy, reading more like documentation and "should correct this" doesn't sound too confident :)

The aim is to provide just enough information to help people make a decision.

HTML tags can prevent rows from grouping correctly.

Does that capture the essence?

yoroy’s picture

sonona’s picture

Issue summary: View changes
FileSize
9.3 KB
12.96 KB

Before:

After:

sonona’s picture

Status: Needs work » Needs review
Issue tags: -Needs screenshots

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.

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.

smustgrave’s picture

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

so sounds like this needs usability review for

Some modules add HTML to the rendered output and prevent the rows from grouping correctly. Stripping the HTML tags should correct this.

vs

HTML tags can prevent rows from grouping correctly.

simohell’s picture

Just a quick comment:

Description says "Stripping the HTML tags should correct this" but we don't have a checkbox for "stripping" only "removing". At least let's use same word for same action. I personally like "strip" more since it's more like developer language, so that kind of indicated we are better off using the common word "remove". Shorter is however almost always better.

Also it's good to keep HTML with tags - I think standard install profile still has vocabulary tags etc. so with checkbox HTML would connect the dots right away.

Also "correct" result should be defined by HTML and CSS standards. It might be better to say "as intended" if code rendered according to standards results in something unexpected.

AaronMcHale’s picture

Status: Needs review » Needs work
Issue tags: -Needs usability review

Usability review

We reviewed this issue at #3336927: Drupal Usability Meeting 2023-02-03, that issue will have a link to the recording.

Those who attended the meeting were: @AaronMcHale, @iszabo, @rkoller, @shaal, and @simohell.

The group recommended shortening the proposed description text, building on the suggestion in comment #20, and altering the label slightly:

Current label: Remove tags from rendered output
Proposed label: Remove HTML tags from rendered output

Proposed description: Modules may add tags that prevent rows from grouping as intended.

The group recommended these changes because we felt this balanced the need to convey what this checkbox will do, with the principle of less is more when it comes to UI text.

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.