Hey guys,
I met a problem with printing function for a normal page.
The content i want to print is from a module menu and i have implemented the MODULE_NAME_menu and this menu call return some html contents.
I find it difficult to handle such things with print module. Because in most situation, the node exists. But in module menu, there is no node there if you don't pass any nid.
So am i missing something or ......
Any suggestion appreciated! Thanks
Here is the code:
function modulename_menu() {
$items['xxx/print'] = array(
'title' => '',
'page callback' => 'my_callback_func',
'access arguments' => array('access my print'),
'type' => MENU_CALLBACK,
'access callback' => TRUE,
);
return $items;
}
function my_callback_func() {
return 'some html content';
}
if i want to print the content returned by my_callback_func, how can i deal with that?
Comments
What?
What?
Contact me to contract me for D7 -> D10/11 migrations.
.
Do you know the basics of writing a module? I mean, can you write a module that has at least one menu item that links to a node, with maybe some text added above or below it?
Do you have a code
Do you have a code sample?
If you are using nids in your hook_menu items, you need to be using placeholders, or using arg() and handling the missing nid in your callback.
--
Read more at iRolo.net