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'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'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['dashboard/%user_uid_optional'] = array(</div><div> 'page callback' => '_mymodule_user_dashboard_template',</div>
<div> 'page arguments' => array(1),</div><div> 'access arguments' => array('access content'),</div><div> 'type' => 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('mymodule_user_dashboard_template');</div><div>}</div><div><br></div><div>function mymodule_user_dashboard_theme() {</div>
<div> $themes = array(</div><div> 'mymodule_user_dashboard_template' => array(</div><div> 'template' => 'templates/dashboard',</div><div> 'arguments' => 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>