DrupalBin
Submit Code
About
Recent Posts
Code
39 min 44 sec
ago
Fix for double entries
56 min 32 sec
ago
Code
1 hour 5 min
ago
double entries
1 hour 16 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
display a node as a menu callback
View
Download
Fix
August 5, 2008 - 5:13am —
yhager
function
mymodule_menu
(
)
{
if
(
$may_cache
)
{
$items
[
]
=
array
(
'path'
=>
'mypath'
,
'callback'
=>
'mymodule_mycallback'
,
'access'
=>
user_access
(
'access content'
)
,
'type'
=>
MENU_CALLBACK
,
)
;
}
}
return
$items
;
}
function
mymodule_mycallback
(
)
{
// calculate $nid
if
(
$nid
)
{
$_GET
[
'q'
]
=
drupal_get_normal_path
(
'node/'
.
$nid
)
;
menu_set_active_item
(
$_GET
[
'q'
]
)
;
return
node_show
(
node_load
(
$nid
)
,
NULL
)
;
}
}
drupal5
hook_menu