By kabaman on
dear list
im trying to overwrite the function theme_menu_item() for a specific block region
say i have the block-regions header, left, right, footer
and only want to change the html for the menu-items which are assigned to the header-block
any idea how to do this ?
thanx in advance
Comments
**Nudge**
I'm also looking for information on how to do this... I'll post back here if I find anything...
What are you trying to
What are you trying to change in the list item? Depending on what you want out of that you could simply add a class to block.tpl.php and work through css.
An alternative would be to override theme_blocks() --plural and set a global for the current region. Since the all the blocks are invoked from there any other function that comes after it should know it's current region.
Inside template.php:
I haven't tested but I'm pretty sure it should work.
works
thats exactly what i was looking for
i just tried the first part/code
thanx
not working :(
hi,
thx for your great solution!!
But if I try the code it always renders menu only once with "left" as current region :(
I really set the block to another regions...
If I skip left by following row, it renders menu again only once at next region in list :(
### if ($region =="left" || $region =="right" || $region =="top" || $region =="footer" ) return;
whats going wrong there? The menu always gets rendered single time at first matching
although there shouldn't be rendered any content..
would be aweful to get some help,
I really need this function :D
greets,
melchior
Drupal 7
This is a great solution, and I've used it a lot over the past few years in Drupal 6 sites. However, "theme_blocks" doesn't exist in Drupal 7, so it doesn't work any more. Does anyone have any ideas for accomplishing the same thing in Drupal 7?
Anyone have any ideas?
Bumping this in hopes of attracting the attention of someone with an idea -- does anyone know how to get the current region from within theme_menu_link() in D7?
A solution
Have you found a solution?
Thanks.
If someone needs this for D8
Here is solution: http://drupal.stackexchange.com/a/219770/32059
I had same problem and I've found it now.