alterations in tpl file work, but not dpm();, dsm(); or drupal_set_message();
You have access to the entire Drupal bootstrap within template files. Template files are loading at the very end of a page request post bootstrap. If dpm() or dpr() is not working it is most likely because you are viewing the site as an anonymous user. The devel module by default does not allow access to it's functionality for anonymous users. Try logging in as admin and you should see the output of your devel module function calls.

As an F.Y.I. template files are not the typical place for a dpm() as you either need to know the variable you are after or put a get_defined_vars() calls inside it which can be quite heavy depending on where you are in stack. It is more common to use dpm()'s in template hooks such as:


template_preprocess_page()
template_preprocess_node()

function template_preprocess_page(&amp;$vars) {
  dpm($vars);
}


Then you can see all the variables that are available to your template files.