In my new module I've created a page with a callback like module_callback() and in most circumstances this trick has been working when combined with the relevant menu items. However I'm now trying to implement local tasks to a single callback like those on a node with urls of the format ?q=module/pagename/[id]/localtask etc. I have these callbacks setup correctly in the non-cached section of the module's menu hook and they seem to work, my callback function outputs to the resulting html page, however it doesn't construct the resulting page with all the drupal themes or blocks or navigation or headers/footers or anything. Anyone any ideas what I'm doing wrong or what I've forgotten to do?

Comments

richardhall’s picture

I'm still stumped on this one. Someone out there knows what I'm talking about here and knows the solution...

nevets’s picture

Without seeing the code I am guessing you are not calling the theme function. It would look something like

print theme('page', $output, $title, $breadcrumbs);

$output is content that you have generated.
$title is optional, if present it is used for the title of the page.
$breadcrumbs is an optional array, if present it is used to generate the breadcrumbs you see on the page.

If this is not the case it would help if you posted the function in question.

Steve

richardhall’s picture

Actually that was very helpful, it was something as daft as the first parameter being missing (even though I copy pasted it from elsewhere in drupal :S). I can't believe I didn't spot this, its taking me a little while to get used to remembering the drupal api functions and syntax. Thanks for your help.