1

I've created a custom module that defines a menu callback; that menu path will call a function which performs some actions and once it's finished, it needs to display the theme with a message as the body.

This used to be doable using theme('page', $message) but in Drupal 7 it only returns the HTML content that would normally appear within the BODY tags.

I know that there is now a html.tpl template, but I'm unsure how I can combine the two to generate a full page.

2 Answers 2

1

This is a wild guess but have you tried:

$html = array('page' => $message);
theme('html', $html);

(or something along those lines)?

3
  • Yes! ;-) It just returns the html but not the body.
    – Camsoft
    Apr 20, 2011 at 22:41
  • you tried passing the body content to the template as a variable?
    – Alex Weber
    Apr 20, 2011 at 23:18
  • Good point, I'll give that a go.
    – Camsoft
    Apr 21, 2011 at 8:09
1

Turn out that you have to return a render array instead of HTML markup like you could of in Drupal 6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.