Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8859

Use page template name as a class in the ASCX Master Template

$
0
0
Hello Everyone,For styling flexibility, I would like to have the template code name of the current page appear as a class in the master template. Something like this: @div id=@mainContent@ class=@currentPageTemplate@@@cms:CMSWebPartZone ZoneID=@zoneContent@ runat=@server@ /@@/div@I found a macro that I think could get me the information I wanted: {% CMSContext.CurrentTemplate.CodeName %}Unfortunately, after a few tries I learned that macros cannot be used inside of an ASCX template. So, is the correct way to write something like this without using macros? Can it be done?Thanks in advance.

Viewing all articles
Browse latest Browse all 8859

Trending Articles