Template Categories

Stefan Sturm asked on September 3, 2015 13:10

Hello,

ist there a way to get the template category name programmatically.

regards st

Correct Answer

Petar Kozjak answered on September 3, 2015 13:52

Hi,

you can use macro: {%Document.DocumentPageTemplate.PageTemplateCategory.CategoryDisplayName|(identity)GlobalAdministrator%} or code behind

var template =PageTemplateInfoProvider.GetPageTemplateInfo(DocumentContext.CurrentDocument.DocumentPageTemplateID);var category= PageTemplateCategoryInfoProvider.GetPageTemplateCategoryInfo(template.CategoryID);category.CategoryName

Please try it out. I didn't test it... :)

0 votesVote for this answer Unmark Correct answer

Recent Answers


Stefan Sturm answered on September 3, 2015 14:12

Hi Petar, thank you for your help! This was exactly what i was looking for!

regards St

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.