Lets make choosing a layout for your entity displays work a bit better than presenting a select list:

for smaller screens we could simply wrap the list of layout icons:

Comments

yoroy created an issue. See original summary.

tim.plunkett’s picture

I think this looks great!

We have no mechanism for this currently, and I'm not sure how I'd go about implementing the "click on an icon" bit. How would it work for keyboard users?

One thing to consider is that layouts can have an entire settings form of their own, which is currently simply added within the fieldset.
Core has no current plan to make use of that, but both DS and Panels do.
We do have core test coverage of it, in the layout_test module.

Another thought was that currently we group layouts by their "category". Right now the "category" corresponds to number of columns they present.
Just wanted to be clear that it was being purposefully abandoned.

yoroy’s picture

StatusFileSize
new30.78 KB

Maybe you can take something from the media library design, which also works with selecting thumbnails. Maybe under the hood these are checkboxes?

Settings forms for layouts: would be good to see examples of that.

On (not) grouping by number of columns: yes, I dropped that intentionally.

Looking at the example in #2660124: Dynamically build layout icons based on well formed config the number of columns is not going to hold as a sensible category. I also had a quick look at how powerpoint, keynote etc. show their slide layouts and there's no grouping there either, nor text labels to describe them so I dropped those as well.

xjm’s picture

xjm’s picture

BTW #3 looks to me like a beloved video game called Lode Runner I played on my Apple II+, or any number of underground Mario levels. Is that one screen, or several different prototypes for the same screen in one image? :) Hopefully the latter?

yoroy’s picture

haha, yes, those are different ways for organising the same set of layouts, my conclusion from that was that organising by number of columns didn't make much sense.

damienmckenna’s picture

+1 for replacing the selector with a list of the thumbnails & titles.

tim.plunkett’s picture

Priority: Normal » Major

Implementing this is not a major or urgent task, but deciding on the UX and flow of this is a blocker for #2822758: Introduce a way to distinguish between different types of layouts, so bumping this for now.

damienmckenna’s picture

Some themes and distributions, and sites, can end up with twenty or fifty layouts, should they all be listed together or should we retain the notion of a "category"?

pixelite’s picture

Issue summary: View changes
Issue tags: +Baltimore2017
StatusFileSize
new268.99 KB

So far, we've had a few ideas:

Add a summary of the current selected layout to the top of the manage display interface and move the layout settings to the top of the page to make it more visible.

Organize the layouts by category, using a selectbox above the layouts.

There's a description property that can be defined for each layout. It would be useful to display this below the layout once it's been selected. This will help users differentiate between different layouts with similar names, especially when there are multiple themes or modules providing layouts.

Layouts selection UI with category selector and icons, and summary at the top of the page.

pixelite’s picture

StatusFileSize
new130.78 KB
new151.96 KB
new183.35 KB
new237.72 KB

Here's a new version of the above image that integrates some feedback:

The title is included for the selected layout, along with the description.

When you click on a layout, the other layouts are displayed in a lighter color to indicate that they are not selected.

Updated title of the details element since layout settings is not descriptive, all you can do is change the layout.

Step 1: You see the current layout in use:

Screenshot of the manage display tab with the current layout visible.

Step 2: You open the 'Change the layout' section and you see the list of layout categories to choose from.

Screenshot of the manage display tab with layout settings open.

Step 3: You click on the layout you want to use and the name and description appear below with a button to apply the change.

Screenshot of the manage display tab with the list of layout images.

Step 4: You click 'Apply layout' to approve the change, which updates the layout displayed below.

Screenshot of the manage display tab with the new layout selected.

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.

tim.plunkett’s picture

Component: layout.module » field_layout.module

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.

andrewmacpherson’s picture

Issue tags: +Accessibility

Some accessibility notes.

#2:

implementing the "click on an icon" bit. How would it work for keyboard users?

  1. They would be <button>s. Needs JS to do anything. It might set a hidden input.
  2. Edit: or <input type="image">
  3. Probably styled radio buttons are best. The input element is visually-hidden. The visible icon is part of the <label>, along with alt text. Needs no JS.

Focus styles are required, obviously.

A more interesting question is how will they work for speech control? Visible text labels are greatly preferred for that because they allow random access in one step. WIthout those, users don't know what to say. So they have to use the 2-step random access method, which is a bit more cognitive load; "show numbers, choose 16".

#3:

Maybe you can take something from the media library design, which also works with selecting thumbnails. Maybe under the hood these are checkboxes?

Close - radio buttons, since you can only choose one.

#10:
Does the blue outline indicate the "selected" state? Remember that keyboard users will need a visible focus when moving between the layout icons to make a selection. If a blue outline means selected, that collides with the convention for indicating focus. Seven uses a blue halo for button focus, and a blue outline is the default focus style for some browsers. So I think there is a good chance of confusing keyboard users, or at least increasing their cognitive load, by having to tell "selected" from "focused".

#11:

When you click on a layout, the other layouts are displayed in a lighter color to indicate that they are not selected

There are several problems with this (most severe first):

  1. The selection is indicated by colour alone, which is a failure of WCAG "Use of color". The distinction will not be easily perceivable by some users, and the distinction will be lost when a Windows high-contrast theme is being used.
  2. Buttons which are pale grey usually indicate disabled buttons.
  3. Image buttons need to satisfy SC 1.4.11 "Non-text contrast" in WCAG 2.1, which means the outlines of the pale icons would need to have a minimum of 3:1 contrast against the white page background. You also need to ensure suitable contrast between the outline and the filler colour. There may not be enough shades of grey for all of this :-(

I recommend that selection is indicated by an additional shape of some kind; a checkmark or similar, adjacent or overlaid on the icon. If overlaid, it will need to be easily distinguishable from the layout icon beneath it, without relying on colour. We already have a similar thing in media library, which Yoroy noted in #3.

If selection is a checkmark, then that means an outline is available for use as the focus indicator, without conflating the two.

anruether’s picture

Component: field_layout.module » layout_discovery.module

I believe this is the correct component as field_layout will be removed.

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.

mgifford’s picture

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.