As of now, the link to configure a section is displayed as a text link. The link to remove a section is displayed as a button.

Layout builder section links

It would be more consistent with the contextual links to move, update, remove blocks to also have contextual links for the section links.

contextual links

Comments

vbouchet created an issue. See original summary.

vbouchet’s picture

Status: Active » Needs review
StatusFileSize
new70.55 KB
new10.21 KB

Find a patch to achieve it.

Layout builder with contextuel links on section

Please note that the patch update the layout twig files. If the layout twig files are customised on your project, you probably need to add {{ title_suffix }} attribute for the contextual link to render.

I have not created any test on purpose as I suspect it will require a lot of discussion before it can be merged in core and the implementation may change.

Status: Needs review » Needs work

The last submitted patch, 2: contextual_section_links-3344037-2.patch, failed testing. View results

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.

johnpitcairn’s picture

I'm not personally a fan of contextual links, they add a discoverability barrier, and everything winds up looking the same. If consistency is the goal, I'd prefer blocks didn't use them either.

See #3042516: Re-evaluate whether Contextual Links are the best interaction for configuring/moving/deleting blocks in Layout Builder

danielveza’s picture

Issue tags: +Needs usability review

I feel like this one should be tagged as needing Usability review as it's a pretty big UI change for LB.

My 2c is that I'm not a big fan of the idea, I feel like having these links as contextual links hides them a bit too much. There is already quite a few contextual links on a page built with LB. Adding more to configure sections as well as blocks makes this messy in my eyes

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.