<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=107010719-10042007>Easiest way is the the following. In this case,
the html output represented by $foo is presented in the content area of
page.tpl. Note you don't need custom theme functions and custom tpl files
to do this. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=107010719-10042007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=107010719-10042007>Now you could invoke the theme engine as well,
but I wanted to make sure you understood this easier way first.
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=107010719-10042007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=107010719-10042007>Dave</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> support-bounces@drupal.org
[mailto:support-bounces@drupal.org] <B>On Behalf Of
</B>Cyberswat<BR><B>Sent:</B> Tuesday, April 10, 2007 11:47 AM<BR><B>To:</B>
support@drupal.org<BR><B>Subject:</B> Re: [support] Templating in Drupal 5.1 -
the cleanest way to do it?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>I have another question regarding this subject. If I create a custom
module how do I use the templating engine to work with the output of the
module? I know this code is bad, but it summarizes what I would like to
do. Any help is appreciated as I'm starting to feel dense from not being
able to figure this out.
<BR><BR>#################################################<BR>module code -
mymod.php<BR>#################################################<BR><BR>function
mymod_menu($may_cache) {<BR> $items = array();<BR> $items[] =
array('path' => 'mymod_view', <BR> 'title' =>
t('mymod_view'),<BR> 'callback' => 'mymod_foo',<BR> 'type' =>
MENU_LOCAL_TASK,<BR> 'access' => user_access('view mymod'),<BR>
'weight' => 0, <BR> );<BR> return $items;<BR>}<BR><BR>function
mymod_foo() {<BR> $data = array('foo' => 'bar');<SPAN
class=107010719-10042007><FONT face=Arial color=#0000ff
size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=107010719-10042007><FONT face=Arial color=#0000ff size=2>
$output = '<h1>Here is the value of '.$data['foo'].' here.
</h1>'; </FONT></SPAN><SPAN class=107010719-10042007><FONT face=Arial
color=#0000ff size=2> </FONT></SPAN><BR> return $<SPAN
class=107010719-10042007><FONT face=Arial color=#0000ff
size=2>output </FONT></SPAN>;<BR>}<BR><BR><BR><BR></DIV></BODY></HTML>