[support] Using the node theme or a template from custom module

DTH david at hartster.org
Mon May 28 21:43:09 UTC 2012


I've got a custom module for D7. On some pages, it returns html. I'm
using this in the page callback

function example_page(){
    return array(
      "#type" => "markup",
      "#markup" => "<p>Lorem ipsum etc</p>",
    );
}

It works fine, but the page (obviously) doesn't use my node.tpl file,
and so it looks different from the rest of the site. It's not that the
node.tpl file is particularly complex, but it does some things like
wrap the node content in divs that have styling applied to them etc.

I could use #prefix and #suffix to wrap the above output in these
divs, but is there either a) some way to reuse my node template or b)
what's the best way to create a quick clone of the node template that
can be reused in render arrays every time I want to output pages from
my module. Do I have to call a theme function by #theme or is there a
way to use an actual template file?


More information about the support mailing list