Personally I deal with situations like this in a custom module by registering a path with a callback function that prints the needed content:
function mymodule_menu() {
$items['somepage/%'] = array(
'title' => 'Somepage',
'page callback' => 'mymodule_ajax_callback',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
function mymodule_ajax_callback($nid) {
if ($node = node_load($nid)) {
$view = node_view($node, 'full');
print drupal_render($view);
}
}
This would get you the view of node 12 without any external markup on 'somepage/12' for example. Note that when you use return instead of print you get the page with additional markup added (just for future reference).
If you want to go with the template approach you could create 2 templates: 'html--blank.tpl.php' and 'page--blank.tpl.php'. The first one should contain only <?php print $page; ?>
and the second <?php print render($page['content']); ?>
. In your template.php file add:
function mytheme_preprocess_html(&$variables) {
if (isset($variables['page']['content']['system_main']['nodes'])) {
$nodes = $variables['page']['content']['system_main']['nodes'];
$key = key($nodes);
if (count($nodes) == 2 && $nodes[$key]['#node']->type == 'my_content_type') {
$variables['theme_hook_suggestions'] = array('html__blank');
}
}
}
function mytheme_preprocess_page(&$variables) {
if (isset($variables['node']) && $variables['node']->type == 'my_content_type') {
$variables['theme_hook_suggestions'] = array('page__blank');
}
}
These solutions will give you a slightly different result, but either should get the job done (just remember to modify them to fit your needs and clear the caches).