Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Enable shortcut.module_link
setting for bartik to show shortcut action link. Either by importing it from admin/config/development/configuration/single/import
Configuration type: Simple configuration
Configuration name: bartik.settings
Paste your configuration here:
third_party_settings:
shortcut:
module_link: true
Or execute this code form devel/php
\Drupal::configFactory()->getEditable('bartik.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(TRUE);
Or run this form root directory.
drush ev "\Drupal::configFactory()->getEditable('bartik.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(TRUE);"
or uninstall batrik put bartik.settings.yml
in core/themes/bartik/config/install
with following code
third_party_settings:
shortcut:
module_link: true
Install bartik and set as default.
Proposed resolution
Fixed the styling
Remaining tasks
Review.
Commit.
User interface changes
Before
After
LTR
RTL
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#10 | fix_shortcut_action-2544390-7.patch | 830 bytes | emma.maria |
Comments
Comment #1
LewisNymanShould we also be able to set the display of the shortcut in the theme settings? It didn't seem to work for me.
Comment #2
emma.mariaI followed the steps to enable Shortcut for Bartik and I couldn't get it to work.
Is it here, like this?
Nothing happens even on reinstall.
Comment #3
jibran#1
@LewisNyman yes it is possible in D7. In D8 it's a third party setting so you have to import it using import page.
@emma.maria Try this form root dir.
\Drupal::service('theme_handler')->themeExists('bartik')
only returns true if bartik is installed. Perhaps it was not firing for you because of that. OTOH you found a new bug in shortcut. if condition should have!\Drupal::service('config.installer')->isSyncing()
in it like this.I have also updated the issue summary with possible ways to enable this setting. Thanks for having a look at it folks.
Comment #4
jibranI ended up creating two issues one for shortcut module one documentation issue #2550385: Update hook_install documentation for editing configuration & #2550357: Fix shortcut_install() and shortcut_themes_installed(): Only update config when syncing flag is FALSE. @emma.maria++
Comment #5
emma.mariaThanks @jibran for adding instructions for enabling this. Let's get this tested and fixed!
Comment #6
emma.mariaComment #7
emma.mariaYay I managed to get Shortcut enabled in Bartik this time!
I took a look at the styles, I agree that the existing ones still need to exist and I also agree with the styles added in the patch.
I also added the correct file comment for CSS files in Core plus added a small visual change to space the star icon a little more away from the page title.
Here are the screenshots:
On hover
Comment #8
jibranPHEW
Looks perfect but we need an actual patch not just interdiff. :P And after RTL screenshot I think we are RTBC here.
Thanks @emma.maria for the fixes.
Comment #9
emma.mariaOops apologies about missing the patch.
Also RTL screenshots:
Comment #10
emma.mariaI will get there eventually.... here's the patch.
Comment #11
jibranFinally patch made an entrances. :D
I think we are done here. Screenshots look good. Updated issue summary with new screenshots.
Thanks @emma.maria for the RTL screenshots.
Comment #12
shahzad-anwar CreditAttribution: shahzad-anwar commentedI tried the patch and it fixes the issue and works for both LTR and RTL Layouts.
Comment #13
alexpottCommitted 9564809 and pushed to 8.0.x. Thanks!