Override node template depending on menu settings How do I override the template of a node based on where it is in the menu?

For example, I create a node, and within the "Menu settings" I put it under some "parent item". I wish to use a specific template for nodes of a particular content type that fall under a particular parent item.
I believe it is possible to achieve this in hook_preprocess_node by calling menu_get_item, checking whether it is the item you are looking for (checking the parent etc.) and then assigning the appropriate template like this: $vars['template_file'] = 'your_template_file';