'get the textual name (2nd parameter in get_cms_setting(\'TEMPLATES\'))
of the template of this page or of the nearest
ancestor. failing to find that, return the name of the default template.'

def get_template_name(self):

    template = self.get_template()
    for t in get_cms_setting('TEMPLATES'):
        if (t[0] == template):
            return t[1]
    return _('default')
