Back to site link for custom blocks

Created on 2 October 2023, 9 months ago
Updated 13 October 2023, 8 months ago

Problem/Motivation

Currently when editing a custom block the "Back to site" button links to the edit page (the page you are already on) due to the fact that custom blocks do not have a standalone view, however the URL does allow access as the canonical url is the edit form.

The expected behaviour would be the same as media (when not allowing media to be viewed standalone) i.e. to link to the front page.

Steps to reproduce

  • Go to a custom block edit page
  • Click "Back to site"

Proposed resolution

The breadcrumb.theme would handle custom blocks in the same way as media (when viewing stand-alone was disabled).

        // Custom block handling (a custom block cannot be viewed standalone).
        if ($entity_id === 'block_content') {
          $url = Url::fromRoute('<front>');
        }
🐛 Bug report
Status

Fixed

Component

Code

Created by

🇬🇧United Kingdom andy_w

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024