Tracking down this Label:

<div id="edit-selected" class="form-item form-type-item form-item-selected" style="display: block;">
<label for="edit-selected">Selected:</label>
<div class="views-selected-options">Content: User posted or commented, Tracker - User: User posted or commented</div>

Which seems to come from core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php and :

    // Add a div to show the selected items
    $form['selected'] = array(
      '#type' => 'item',
      '#markup' => '<div class="views-selected-options"></div>',
      '#title' => t('Selected') . ':',
      '#theme_wrappers' => array('form_element', 'views_ui_container'),
      '#attributes' => array('class' => array('container-inline', 'views-add-form-selected')),

Only local images are allowed.

#9 drupal8-RemovedLabel-2044521-9.patch915 bytesDuaelFr
PASSED: [[SimpleTest]]: [MySQL] 57,165 pass(es).
[ View ]
#7 drupal8-RemovedLabel-2044521-7.patch915 bytesbowersox
PASSED: [[SimpleTest]]: [MySQL] 57,437 pass(es).
[ View ]
#7 Screen Shot 2013-07-21 at 4.12.22 PM.png207.76 KBbowersox
Screen Shot 2013-07-17 at 8.21.37 PM.png125.14 KBmgifford


Issue tags:+Novice, +VDC


Apparently, the tag is generated by the Form API, based on the following key :
'#title' => t('Selected') . ':',
in the $form['selected'] array.

I'm not sure this issue has to be tagged "Novice". People knowing the Form API are more experienced to tackle this point.

Let's define the desired solution. What markup should we have, and what Form API attributes will generate that?

We could use a span...
<span class="views-selected-label">Selected:</span>

and define that new class in views_ui.admin.theme.css...
.views-selected-label { font-weight: bold; }

Should we use an H3/H4 instead of span? In other places in core we've used headings, but here we want this label to be inline, and semantically a heading is not appropriate. A span is probably more appropriate.

To apply this span markup using the Forms API, we could get rid of the #title attribute and put the span into the #markup attribute.

Feedback appreciated.

I would go with the same kind of html as the normal "label" on a views field. This label switched to a different html element before.

@dawehner, do you have an issue number to reference?

Issue tags:+TwinCities

Status:Active» Needs review
new207.76 KB
new915 bytes
PASSED: [[SimpleTest]]: [MySQL] 57,437 pass(es).
[ View ]

Please review this patch. It makes use of an existing CSS class and generates this markup:

<span class="views-ui-view-title">Selected:</span>

Also, the double-colon is now a single-colon. I assume that is the desired visual look. Screenshot attached.

To test this, open up Structure > Views, then edit any view, then under Fields click the Add button. Once the popup opens and you select a field, this "Selected:" bit appears at the bottom.

Status:Needs review» Reviewed & tested by the community

Code looks good. Patch works as advertised.

Status:Reviewed & tested by the community» Needs review
new915 bytes
PASSED: [[SimpleTest]]: [MySQL] 57,165 pass(es).
[ View ]

The single-colon should be included in the t() to be consistent with core and to allow non-english people to add a space before if this is how their language work.

See :

  • core/modules/action/lib/Drupal/action/ActionListController.php:123
  • core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php:63
  • core/modules/forum/forum.module:23
  • core/modules/help/lib/Drupal/help/Tests/HelpTest.php:76
  • core/modules/help/lib/Drupal/help/Controller/HelpController.php:53
  • core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateInterfaceTest.php:92:
  • core/modules/locale/
  • core/modules/locale/locale.install:327:
  • ...

Status:Needs review» Reviewed & tested by the community

Thank you!

Status:Reviewed & tested by the community» Fixed

Committed 4dfc5e3 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.