While using primary links with secondary links as sub-items, is there a function to print all the secondary links for a given non-active primary link?
For example:
-A |-1 |-2 -B |-3 |-4 -C |-5 |-6
Let us say I click on primary link A but I'd like to print somewhere on the page the secondary links under B (3 and 4). Is there a way to do it?
My PHP skills aren't that great and I've been reading a lot about Drupal but I can't seem to find the function I need to do that.
Thanks for any help. -- Dany V.
Hi Dany,
I just use the primary links 'menu' instead of the primary and secondary 'links'.
Set the second level menu items to be 'expanded', then enable the menu block (such as in the header region).
Style with CSS however you want. (I use this for a drop-down menu).
I know this probably isn't the answer you are looking for, so to answer your real question... have a look at the API docs for menu functions, such as this one: http://api.drupal.org/api/function/menu_get_menu/5
Cheers, Ross http://rosskendall.com
danyv@focusweb.ca wrote:
While using primary links with secondary links as sub-items, is there a function to print all the secondary links for a given non-active primary link?
For example:
-A |-1 |-2 -B |-3 |-4 -C |-5 |-6
Let us say I click on primary link A but I'd like to print somewhere on the page the secondary links under B (3 and 4). Is there a way to do it?
My PHP skills aren't that great and I've been reading a lot about Drupal but I can't seem to find the function I need to do that.
Thanks for any help.
Dany V.
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Among the functions listed in the Drupal docs for Drupal 5.x (see http://api.drupal.org/api/group/menu/5 ) are
theme_menu_tree(pid) (where pid is the parent id)
theme_menu_item(), which would be used in the following manner (we don't call theming functions directly, but via the theme() function):
theme(menu_item, 80, FALSE)
where 80 is the mid (menu item id)
just as an example.
Victor Kane http://awebfactory.com.ar
On 9/12/07, danyv@focusweb.ca danyv@focusweb.ca wrote:
While using primary links with secondary links as sub-items, is there a function to print all the secondary links for a given non-active primary link?
For example:
-A |-1 |-2 -B |-3 |-4 -C |-5 |-6
Let us say I click on primary link A but I'd like to print somewhere on the page the secondary links under B (3 and 4). Is there a way to do it?
My PHP skills aren't that great and I've been reading a lot about Drupal but I can't seem to find the function I need to do that.
Thanks for any help.
Dany V.
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
I found this function yesterday, my problem was that I was trying to get it to display the whole sub level of a primary link so it never printed what I needed. I managed to do this today using what you suggested but with a new block instead of using the secondary links.
Thanks for the help.
Quoting Victor Kane victorkane@gmail.com:
Among the functions listed in the Drupal docs for Drupal 5.x (see http://api.drupal.org/api/group/menu/5 ) are
theme_menu_tree(pid) (where pid is the parent id)
theme_menu_item(), which would be used in the following manner (we don't call theming functions directly, but via the theme() function):
theme(menu_item, 80, FALSE)
where 80 is the mid (menu item id)
just as an example.
Victor Kane http://awebfactory.com.ar
FocusWeb (514)278-1573