Problem/Motivation

Based on this thread in Drupal Slack I have noticed that it might be hard for new people to figure out how to add content into empty slots.

It's not really intuitive to add content into empty slots.

Proposed resolution

I think we should show something like Add content in empty slots and when clicking them we show the Blocks panel

User interface changes

  • Empty slots act as clickable buttons which open the Blocks overview

Mockup

Note that I have removed the Tree sidebar button because I am not using this in projects and this gives a good impression about a nice OOTB configuration that just comes with Components and Content.

Comments

yannickoo created an issue. See original summary.

yannickoo’s picture

Issue summary: View changes
yannickoo’s picture

Issue summary: View changes
StatusFileSize
new78.93 KB
yannickoo’s picture

StatusFileSize
new15.06 KB

Deleted comment

yannickoo’s picture

Issue summary: View changes
thamas’s picture

Maybe Libraries could be renamed even to Single Directory Components, not just to Components(?). Or could there be other types of components too?

yannickoo’s picture

Maybe that will be too long for that limited space. Currently it’s possible to see the Components, Blocks and Presets there.

yannickoo’s picture

pdureau’s picture

Maybe Libraries could be renamed even to Single Directory Components, not just to Components(?). Or could there be other types of components too?

SDC is hardcoded now, but it is not a deep hardcoding, it is easy to make it generic.

Once #3531521: Layout plugins support will be merged, we will call "Component" in the Library panels any source plugin which:

  • can be injected in a slot (because they output a Drupal renderable or target a prop type which can be converted to a renderable)
  • and can have slots themselves (because they implement SourceWithSlotsInterface)

So SDC is the only option for now, but we can have more later.

In "Blocks" library, they will be the sources plugins which:

  • can be injected in a slot
  • but can't have slots themselves
pdureau’s picture

I think we should show something like Add content in empty slots and when clicking them we show the Blocks panel

There is a crazy but exciting idea to make slot content a new type island plugin (alongside menu items, library panels, view panels, contextual panels, buttons...):

  • The current dropzone can be one of those plugins instead of being hardcoded in BuilderPanel and LayersPanel
  • Yannick's proposal (Empty slots act as clickable buttons which open the Blocks overview) can be a settings of this "dropzone" island or its own plugin.
  • Christian Wiedemann wanted to add a similar but different mechanism:
    • If the slot is empty a "Add" button with the list of sources (components & blocks) in a modale, on click the source is added in the slot without the need of drag-and-dropping
    • If the slot is already busy, two "Add" buttons, one at the beginning of teh slot, one at the end, with the same mechanism
pdureau’s picture

There is a crazy but exciting idea to make slot content a new type island plugin (alongside menu items, library panels, view panels, contextual panels, buttons...):

We are working on it here: #3594176: Slot handlers as island plugins

pdureau’s picture

Category: Task » Feature request