[solved] Get name of template assigned to page
Posted: Wed Sep 09, 2015 1:37 am
Is there a method for returning the name of the template that is assigned to a given page ID/alias?
Thanks.
Thanks.
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
$hm = CmsApp::get_instance()->GetHierarchyManager();
$node = $hm->sureGetNodeByAlias($the_content_id_or_alias);
$content_obj = $node->GetContent(TRUE);
$template_id = (int) $content_obj->TemplateId();
$design_id = (int) $content_obj->GetPropertyValue('design_id');
$template = CmsLayoutTemplate::load($template_id);
$template_name = $template->get_name();
$design = CmsLayoutDesign::load($design_id);
$design_name = $design->get_name();