I have the following code in my module in D7. My intention is to have my custom template loaded in place of page.tpl.php for this specific page, and to have the template file in the module directory rather than having page--mypage.tpl.php in the theme directory.<div>
<br></div><div>The problem I&#39;m running in to is that after the template is loaded, it complains that none of the page variables (logo, etc) exist. I realize that my arguments array is empty in the code, but in looking around (in all the wrong places, apparently) I can&#39;t figure out what to pass.</div>
<div><br></div><div><div>function mymodule_user_dashboard_menu() {</div><div>  $items = array();</div><div><br></div><div>  $items[&#39;dashboard/%user_uid_optional&#39;] = array(</div><div>    &#39;page callback&#39; =&gt; &#39;_mymodule_user_dashboard_template&#39;,</div>
<div>    &#39;page arguments&#39; =&gt; array(1),</div><div>    &#39;access arguments&#39; =&gt; array(&#39;access content&#39;),</div><div>    &#39;type&#39; =&gt; MENU_CALLBACK,</div><div>  );</div><div><br></div><div>  return $items;</div>
<div>}</div><div><br></div><div>function _mymodule_user_dashboard_template() {</div><div>  return theme(&#39;mymodule_user_dashboard_template&#39;);</div><div>}</div><div><br></div><div>function mymodule_user_dashboard_theme() {</div>
<div>  $themes = array(</div><div>    &#39;mymodule_user_dashboard_template&#39; =&gt; array(</div><div>      &#39;template&#39; =&gt; &#39;templates/dashboard&#39;,</div><div>      &#39;arguments&#39; =&gt; array(),</div>
<div>    )</div><div>  );</div><div><br></div><div>  return $themes;</div><div>}</div><div><div><br></div>-- <br>---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div>
<div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div><br>
</div></div>