hook_theme()

Events happening in the community are now at Drupal community events on www.drupal.org.
PixelClever's picture

using hook_theme to style module output

Hello everyone,
I am writing a module that requires quite a bit of theming and I want to be able to use a tpl to control the layout of the page callback on a menu item. I have tried using the theme() function like so but I am getting a blank screen in response:

in the menu code: 'page callback' => 'featured_page',

the callback function:

function featured_page () {
$hello = "Hello world";
return theme("main_page", $hello );
}

the theme function:

function bookeditions_theme() {
$path = drupal_get_path('module', 'bookeditions');
$theme['main_page'] = array(

Read more
Subscribe with RSS Syndicate content