Hiding admin toolbar and linking off of the site to the project page is counter intuitive

Created on 11 April 2024, 3 months ago
Updated 23 May 2024, about 1 month ago

Problem/Motivation

I keep clicking the mercury editor logo trying to get back to the main site and ending up on Drupal.org.
Is there a way to disable the branding and have the admin toolbar show up?

Steps to reproduce

Enable mercury editor for a content type
Edit one of those pages

Proposed resolution

Link the logo to the home page.
Make the logo configurable.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

2.1

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

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

Comments & Activities

  • Issue created by @nicxvan
  • πŸ‡΅πŸ‡±Poland wotnak

    There doesn't currently seem to be a config option for that. Both hidding toolbar and linking logo to drupal.org is hardcoded.

    It however can be fixed with a bit of custom code. Logo link is hardcoded in the page--mercury-editor template that can be overriden and showing admin toolbar is controlled by the `_hide_admin_toolbar` route option that can be altered β†’ . I'm using following route subscriber to do that:

    class MercuryEditorRouteSubscriber extends RouteSubscriberBase {
      /**
       * {@inheritdoc}
       */
      protected function alterRoutes(RouteCollection $collection): void {
        // Show admin navigation on Mercury Editor route.
        $mercuryEditorRoute = $collection->get('mercury_editor.editor');
        if ($mercuryEditorRoute !== NULL) {
          $mercuryEditorRoute->setOption('_hide_admin_toolbar', FALSE);
        }
      }
    
    }
    

    It works quite well for the new admin navigation β†’ (combined with changes from https://www.drupal.org/project/mercury_editor/issues/3449328 ✨ Hide new drupal admin navigation on mercury editor routes Needs review ), not sure how it will look with other admin toolbars but it should make them show up.

Production build 0.69.0 2024