<!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.&nbsp; In this case, 
the html output represented by $foo is presented in the content area of 
page.tpl.&nbsp; 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>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=107010719-10042007>Now you&nbsp; 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>&nbsp;</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.&nbsp; If I create a custom 
module how do I use the templating engine to work with the output of the 
module?&nbsp; I know this code is bad, but it summarizes what I would like to 
do.&nbsp; 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>&nbsp; $items = array();<BR>&nbsp; $items[] = 
array('path' =&gt; 'mymod_view', <BR>&nbsp; 'title' =&gt; 
t('mymod_view'),<BR>&nbsp; 'callback' =&gt; 'mymod_foo',<BR>&nbsp; 'type' =&gt; 
MENU_LOCAL_TASK,<BR>&nbsp; 'access' =&gt; user_access('view mymod'),<BR>&nbsp; 
'weight' =&gt; 0, <BR>&nbsp; );<BR>&nbsp; return $items;<BR>}<BR><BR>function 
mymod_foo() {<BR>&nbsp; $data = array('foo' =&gt; 'bar');<SPAN 
class=107010719-10042007><FONT face=Arial color=#0000ff 
size=2>&nbsp;</FONT></SPAN></DIV>
<DIV><SPAN class=107010719-10042007><FONT face=Arial color=#0000ff size=2>&nbsp; 
$output =&nbsp;'&lt;h1&gt;Here is the value of&nbsp;'.$data['foo'].' here. 
&lt;/h1&gt;';&nbsp;</FONT></SPAN><SPAN class=107010719-10042007><FONT face=Arial 
color=#0000ff size=2>&nbsp;</FONT></SPAN><BR>&nbsp; return $<SPAN 
class=107010719-10042007><FONT face=Arial color=#0000ff 
size=2>output&nbsp;</FONT></SPAN>;<BR>}<BR><BR><BR><BR></DIV></BODY></HTML>