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.
The attached patch improves the display for navigation menus if also contextual links are enabled.
Comment | File | Size | Author |
---|---|---|---|
#13 | tma.patch | 1.22 KB | jurgenhaas |
#3 | aperture original.jpg | 17.81 KB | jurgenhaas |
#3 | aperture modified.jpg | 17.05 KB | jurgenhaas |
#3 | aperture original dropdown.jpg | 31.04 KB | jurgenhaas |
#3 | aperture modified dropdown.jpg | 31.24 KB | jurgenhaas |
Comments
Comment #1
bengtan CreditAttribution: bengtan commentedHi,
I'm sorry, but I think I misunderstand something.
Without this patch, both themes The Morning After and Aperture already work with Contextual Links ... at least, as far as I can tell.
Can you please tell me how the patch is supposed to improve things?
Comment #2
bengtan CreditAttribution: bengtan commentedRelated: #1362338: Support for contextual links
Comment #3
jurgenhaasSorry, I should have explained the problem in more detail. What I've done is to inject a contextual links menu for primary links (= main menu) and that won't be displayed properly without the modifications in the css file.
There are two negative effects that I can explain and that are visible in the attachments to this post:
1) The widget on the right is not displayed properly, see "aperture original.jpg" and "aperture modified.jpg"
2) The dropdown from the widget widget on the right is not displayed properly, see "aperture original dropdown.jpg" and "aperture modified dropdown.jpg"
Please let me know if you need more details.
Comment #4
bengtan CreditAttribution: bengtan commentedHi,
> What I've done is to inject a contextual links menu for primary links
Is this new contextual links menu part of Drupal core (because I don't see it in my test site(s))? If it is, I'm happy to include support for it in the theme(s). If not ... I'm a bit wary of supporting a one-off feature or something which may be obsoleted by Drupal core later on.
Comment #5
jurgenhaasYes, there is a simple hook in Drupal core that allows to attach contextual link menus to any kind of object on a page and the primary menu in particular is something that desperatly needs contextual links.
The proposed changes in the CSS are - even without the contactual link requirement - just a bit more specific to the elements in your great template. So there shouldn't be any harm in adding them into the theme.
Comment #6
bengtan CreditAttribution: bengtan commentedHi,
For the patch for tma.theme ...
Without actually being to test like your setup ...
Are the 'ul#main-menu' declarations actually necessary?
I fail to see how ul#main-menu would be different from #main-menu in behaviour.
Comment #7
jurgenhaasI guess you're right, #main-menu is just as good.
Comment #8
bengtan CreditAttribution: bengtan commentedHi,
I've just tested your patch and it changes the appearance of the navigation bar incorrectly. I think your patch is incomplete.
Comment #9
jurgenhaasIn which way, can you illustrate the effect?
Comment #10
bengtan CreditAttribution: bengtan commentedHi,
The change of declaration from #navigation ul to #navigation ul.links results in the menu link text not being styled properly since #navigation ul.links no longer applies to it. As a result, the menu link text is a dark colour on a dark background.
Other than that, there is no other visible change ... but there is also nothing else in the patch which looks related to contextual links at all. The patch is very very small.
Perhaps you attached the wrong patch file?
Comment #11
jurgenhaasWhy should it not apply anymore? THe only ul that is available in #navigation does have the links class, so the selector "#navigation ul.links" should be perfectly right. Can't see what's wrong with it.
Comment #12
bengtan CreditAttribution: bengtan commentedHi,
Interesting ...
When I tested and got the result in #10, I had reverted the ul#main-menu declarations to just #main-menu. It does have an effect.
If I test the patch without any modifications, it works.
Without the ul#main-menu declarations, it breaks.
So ... comment #10 is bogus and you have my apologies there.
However, the problem now has shifted ....
Stylistically, I don't like the ul#main-menu declarations. I feel that #main-menu should be sufficient. Can you please re-roll your patch to use #main-menu declarations?
Comment #13
jurgenhaasNo worries, CSS can be confusing some times. I have attached the shortened patch which is working fine here, unless I've overlooked something. Please let me know.
However, while looking at the code I was thinking that we could make the definitions for the a elements within #navigation and #main-menu still a bit more specific so that really only those get affected that should be.
Comment #14
bengtan CreditAttribution: bengtan commentedHi,
Sorry, the patch from #13 isn't correct. The non-active anchor text within #navigation loses its white colour.
Comment #15
jurgenhaasYou're right, sorry I missed that. I've just checked the situation and found out that this is why we had ul#main-menu in the first patch. So I revert back to that first patch.
Comment #16
Hanno CreditAttribution: Hanno commentedIntersting, could you post the code you used to enable contextual links on the primary menu?
Comment #17
jurgenhaasNo problem, here you go: