How can I load a theme template to render $submitted I'm trying to replace the output of $submitted in my nodes. I have found how to replace the value which is fine. The problem I'm facing is how to load a template file properly.

function pod_preprocess_node(&amp;$vars) {
  $vars['submitted'] =  t('!datetime ', array(
    '!datetime' =&gt; include_once(__DIR__.'/system/submitted.tpl.php')
  ));
}


As you can see above, I've just included a template file and in there I can use $vars but this is clearly sub optimal. What I'd like to do is just load a template file from my theme which has some sensibly named variables in.

I've looked at hook_theme() which now allows me to call theme('pod_submitted', $vars) but I don't know how to make pod_submitted() include the right file etc.

I assume that somewhere I need to do the following

$vars['theme_hook_suggestions'][] = 'system__submitted';


But I'm not sure how my template function relates to/knows which template to call.
Well, what you're looking for is hook_theme. With hook_theme you can declare new theme implementations, which can be either functions or templates. I'll stick with templates for this answer. Just define it in YOURTHEME's template.php file:

function YOURTHEME_theme($existing, $type, $theme, $path) {
  return array(
    'YTsubmitted' =&gt; array(
      'template' =&gt; 'YTsubmitted',
      'variables' =&gt; array('whom' =&gt; NULL, 'when' =&gt; NULL),
    ),
  )
};


I'm calling the theme hook YTsubmitted and the template file  YTsubmitted. Those names don't need to be the same, but I'm prefixing to avoid collisions. Now, whenever you call theme('YTsubmitted'), Drupal will look for YTsubmitted.tpl.php in your theme and use it for rendering. You can pass variables to it when calling, just like theme('YTsubmitted', array('whom' =&gt; 'Jake the dog')). Variables will default to values set when defining the theme hook in hook_theme (NULL in our example). But you can also preprocess variables:

function YOURTHEME_preprocess_ytsubmitted(&amp;$vars, $hook) {
  $vars['extra'] = 'Mathematical!';
}


And now you can use it in your template file (YTsubmitted.tpl.php):

&lt;p&gt;Submitted by &lt;?php print $whom ?&gt; right after &lt;?php print $when ?&gt;. &lt;?php print $extra ?&gt;!&lt;/p&gt;


That's precisely how Drupal sets several of the templates and its variables. For instance, node.tpl.php will print the $submitted variable, which can be redefined in your template.php file:

function YOURTHEME_preprocess_node(&amp;$vars, $hook) {
  $vars['submitted'] = theme('YTsubmitted', array('whom' =&gt; 'Finn the human'));
}


AAAaaand you're done.