DrupalBin
Submit Code
About
Recent Posts
float?
1 hour 37 min
ago
views handler
5 hours 7 min
ago
Code
5 hours 23 min
ago
Code
5 hours 24 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for Code to print "top parent" node of the site section
View
Download
Fix
November 20, 2007 - 9:53pm — Anonymous
<?php
$m_items
=
_menu_get_active_trail
(
)
;
// get active menu trail into an array
$m_item
=
$m_items
[
1
]
;
// the second entry is the top parent (assumes we have one main menu container, e.g. primary links)
print
menu_item_link
(
$m_item
)
;
// this function takes the menu id (mid, which is $m_item) and creates a link to the page
?>
menu
snippet