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.
I was trying to get a view for a sub-menu item using Responsive Dropdown Menus but I get
<a href="site/<view>"></a>
instead of the content of the view itself.
It seems that some code needs to get changed into Responsive Dropdown Menus as they did in Superfish, https://www.drupal.org/node/1855996.
Since I need that resolved today I will try to patch Responsive Dropdown Menus to make it work.
Wish me good luck ;-)
Comment | File | Size | Author |
---|---|---|---|
#5 | responsive_dropdown_menus.patch | 980 bytes | alauzon |
#4 | responsive_dropdown_menus.diff | 1.01 KB | alauzon |
#2 | responsive_dropdown_menus.diff | 1.04 KB | alauzon |
Comments
Comment #2
alauzon CreditAttribution: alauzon as a volunteer commentedHere is my diff. I added a theme function like it has been done in https://www.drupal.org/node/1534734#comment-5874710.
Please tell me what you think of my patch. It's my first contribution so I welcome any comments.
Comment #3
alauzon CreditAttribution: alauzon commentedComment #4
alauzon CreditAttribution: alauzon commentedI removed a line that did not need to be there. Here is my new patch.
Comment #5
alauzon CreditAttribution: alauzon commentedRenamed it. :-)
Comment #6
alauzon CreditAttribution: alauzon as a volunteer commentedComment #7
alauzon CreditAttribution: alauzon as a volunteer commentedComment #8
mglamanSo I'm curious as to why we need to do this in this way? It seems like overhead to have to pass this off to a theme function to return the same output, which in turn could call a theme function. That issue from Superfish doesn't link to any code changes as an example.
Does this patch work for you? Looking at menu_views code I see the following
Which means it required Superfish to implement its own, so it can override it. So there'd need to be a patch made against menu_views to support this module, then? That module hasn't had a commit since 2013. I'm not sure I want to add this change for just that use case. Unless I can be proven the performance overhead is minimal.
Comment #9
markhalliwellBecause a module isn't responsible for theming HTML markup (which is what a "link" ultimate is). Simply using the
l()
function isn't enough. There is no way for a module/theme to intercept this. By placing it in theme hook, it allows other projects to override it when necessary, which is the case in menu_views when a link's href is<view>
.Yep. Just committed the code in #2552755: Integration with Responsive Dropdown Menus.
Because it's relatively stable code and does just one thing: provide a view as a menu item.
Pretty sure the above statement is proof enough. Once it's in, you don't have to worry about it. If it makes you feel any better, add some comments around the code to explain why all this is necessary (see first response).
Comment #10
mglamanmarkcarver, thanks for the reply and info! I'll circle back to this