This is default behavior of Drupal core toolbar and I think it's a serious issue that shortcuts are hidden by default.
I'm an experienced Drupal user (but not so much with shortcuts because I've always used admin_menu) and I couldn't find the shortcut bar. I can imagine people who are new to Drupal and don't know that shortcuts exist will never find the shortcuts bar because they wouldn't know where to look and what to look for.
I'm going to use shortcuts in a distribution that has admin_menu enabled by default so it's a serious issue if there is no way to have shortcuts display out of the box.
Fix, add active class by default:
// Add shortcuts bar.
$content['shortcut'] = array(
'#access' => module_exists('shortcut'),
'#weight' => 200,
'#prefix' => '<div class="shortcut-toolbar active">',
'#suffix' => '</div>',
);
Comment | File | Size | Author |
---|---|---|---|
#13 | admin_menu-n1788822-13.patch | 722 bytes | DamienMcKenna |
#12 | admin_menu-shortcuts_active-1788822-12.patch | 475 bytes | emmonsaz |
#10 | admin_menu-shortcuts_active-1788822-10.patch | 2.11 KB | jamsilver |
#5 | admin_menu-shortcuts_active-1788822-5.patch | 2.11 KB | malcomio |
#2 | admin_menu-toolbar-active-by-default-1788822-2.patch | 612 bytes | Peacog |
Comments
Comment #1
rtdean93 CreditAttribution: rtdean93 commentedI agree. Where did you put this code?
Comment #2
Peacog CreditAttribution: Peacog commentedThanks for the fix. I've rolled a patch for it.
Comment #3
jhubley CreditAttribution: jhubley commentedJust added this patch to a client site. Really helpful, thanks!
Comment #4
wildflower_0002 CreditAttribution: wildflower_0002 commentedI was also able to apply this patch with success
Comment #5
malcomio CreditAttribution: malcomio commentedThis would be a nice addition, although I'd prefer to make it configurable - here's a patch that does that.
Comment #6
gavin.hughes CreditAttribution: gavin.hughes commentedTest patch #2 and it works perfectly
Comment #7
rickupdegrove CreditAttribution: rickupdegrove commentedThis is a great addition. Patch #5 works great and I like the added configuration option.
Comment #8
dtamajon CreditAttribution: dtamajon commented#5 is working properly, but just a little CSS adjustment on admin_menu_toolbar.css
Should be:
Comment #9
malcomio CreditAttribution: malcomio commentedI'd say that the CSS change should be a separate issue - the misalignment exists with or without this patch.
I've created #2370505: Shortcuts misaligned for this issue.
Comment #10
jamsilver CreditAttribution: jamsilver commentedRerolled patch #5 for latest version of admin_menu (7.x-3.0-rc5).
Comment #11
emmonsaz CreditAttribution: emmonsaz commentedAfter applying the #10 patch, setting
$conf['admin_menu_shortcuts_active'] = 1;
in settings.php enables the Expand shortcuts by default checkbox by default but not the Shortcuts checkbox. Is there a way to enforce (via settings.php) the shortcuts to display?Update: I solved it with this
Comment #12
emmonsaz CreditAttribution: emmonsaz commentedI still had issues with the shortcuts displaying after clearing my browser cache so I ended up doing this:
1. Apply the attached patch (it's hacky, I know...)
2. Add this to settings.php
Comment #13
DamienMcKennaAlternatively, how about this - enable the Shortcut option during hook_enable().
Comment #14
DamienMcKennaComment #15
scotwith1tThese all have (small) issues:
The approach from @emmonsaz in #12 simply makes sure the shortcut component is enabled in admin_menu and then clicks it. This is fine if you want to assume that everyone will want to have the shortcuts open by default and make that not be configurable.
The patch in #10 has the opposite problem, in that the checkbox works fine, but doesn't trigger the extra 'admin-menu-with-shortcuts' class you get by clicking on the expander arrow, so the expanded shortcuts are just sitting on top of the content until you click it closed and then open again to get that needed class.
@DamienMcKenna's idea assumes everyone will want the shortcuts enabled by default and I don't think that really works either...
I'm hoping to keep using the solution in #10, but it just needs to making sure the js is triggered to add the extra class, that's really the only thing missing IMHO.
Comment #16
truls1502I am sorry for no reply until now.
There are many issues regarding this module admin_menu which is a bit difficult for us to follow up since some of the issues might be already outdated, or is already fixed by the module or any other modules or itself core which means that the problem might no longer need to be fixed.
We can see that the issue has been created for a few years ago, I hope it is okay for you that I am postponing the issue, and give you around two weeks. If you still face the problem, could you tell us the step by step when until you get the error message or what is frustrated you, and a list of modules you are using related to admin_menu and a screenshot that might help us? So it makes us easier to reproduce your issue.
However, after two weeks with no feedback - we will close this issue. So in case, you noticed it after the issue is closed, do not hesitate to reopen it like and fill information which is mentioned above.
So before giving us a feedback, do you mind to test it again with our latest 7.x-3.x-dev?
Thank you for understanding! :)
Comment #17
truls1502This issue has been automatically marked as closed because it has not had recent activity after the last post.
However, if you or someone is still facing the same issue as described to the issue, could you please to re-open the issue by changing the status of the issue, and add an explanation with more details which can help us to reproduce your situation.
Again, thank you for your contributions! :)