Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Nov 2009 at 21:13 UTC
Updated:
21 Aug 2014 at 16:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunJust found #588148: theme_links() is not really themeable, which tries to do the same to theme_links.
Comment #2
sunUpdated for the more failsafe naming standard mentioned in #588148: theme_links() is not really themeable
Comment #3
mooffie commentedIn addition to your proposal,
Wouldn't it be nice to do
drupal_alter('menu_tree_output', $output, $menu_name)on the result of menu_tree_output()?Rationale:
Overriding theme_menu_link() and theme_menu_tree() is nice, but inside these two functions you still don't know about the surrounding items. E.g., inside theme_menu_link() you don't know your position so you can't add 'odd' / 'even' classes.
Comment #4
sunFor that, you can use http://api.drupal.org/api/function/hook_block_view_alter/7
Comment #5
sunAnything left here?
Comment #7
catchMarked #408148: Create sub-theme functions for rendering menus as dup.
Comment #8
sunSo is this RTBC?
Comment #9
catchLooks great. We're a bit too late for #408150: Add "Welcome, $username" to user links but still nice to have
Comment #10
effulgentsia commentedPlease also see #653622: Make the '__' pattern for theme suggestions easier to use.
Comment #12
effulgentsia commentedas per #9
Comment #13
webchickI committed #653622: Make the '__' pattern for theme suggestions easier to use. This one will need a re-roll.
Comment #14
effulgentsia commentedre-rolled.
Comment #15
webchickIn retrospect, it's probably a bit late for all three of these patches, but since I committed the first in the series, I guess we might as well finish the set. At least it doesn't break anything. :) (famous last words)
Committed to HEAD. Needs documenting in the theme upgrade guide.
Comment #16
effulgentsia commentedI started to document this, but stopped, realizing that a bug that was fixed in D6, but not yet in D7 is preventing this particular use-case from working. I think it makes sense to have #241570: Theme preprocess functions do not get retained when using patterns get resolved before telling theme developers about this cool new toy that doesn't work yet.
Comment #17
effulgentsia commentedChanging status to reflect #16.
Comment #18
hass commented#338027: Better menu template suggestion has been marked as duplicate
Comment #19
effulgentsia commented#241570: Theme preprocess functions do not get retained when using patterns landed, so: http://drupal.org/update/theme/6/7#theme-suggestions-for-menus.
Please see #588148-39: theme_links() is not really themeable for a still open question about how to best document the same for theme_links().
Comment #21
frogrod commentedit doesn't work when the menu name is longer than one word.
[menu_name] => secondary-menu
you can't have dashes in php function names
themeName_menu_link__management -works
but it never pics up the secondary menu
intel_agate_menu_link__secondary_menu it's trying to match the - and not an underscore.
Comment #22
jitse commentedI would like to confirm #21.
As PHP does not allow dashes in function signatures using the proposed naming method does not work for newly created menus as new menunames are always prepended with menu.
No time to look into the theme suggestions so no further contributions there.
Comment #23
elijah lynn