How can I set a placeholder variable in page.tpl.php from a page callback? I have a value in page.tpl.php that I would like to set in page callbacks, independently from the main content. 

In page.tpl.php:

&lt;?php print $placeholder ?&gt;

&lt;?php print render($page['content']); ?&gt;


What I would like to do in the page callback:

function my_module_page_callback_foo() {
  $placeholder = 'foo';
  return 'Page Content';
}


Obviously, that isn't going to get me very far. 

I'm hesitant to use hook_preprocess_page because then I'll have unnecessary conditional logic to determine what the menu item is (won't I?). Is there another, 'drupal way' of doing this? 

I'm coming from a more 'Zend-y' world where I have access to my view and my layout variables from the controller.
There are a few possibilities, not sure which one would work best for you. There isn't a really easy way to do that.

I would say the "drupal way" of doing that would be to expose your additional content as a block. You can configure that to only show up on specific pages and place it above the main content.

There is also hook_page_alter(), but that requires the same conditonal checks as a template_preprocess.

You could also return a render array in your page callback and then display it separately in your page.tpl.php, something like render($page['content']['system_main']['part_a']) and so on. You could do that only in a template suggestion for a specific page, like page--yourpath.tpl.php.

To avoid messing with page.tpl.php too much, there is also the possibility of overriding the so called 'delivery_callback' (see menu_execute_active_handler() in your menu router item for that page. The default delivery callback is drupal_deliver_html_page().