I'm begining all that stuff, so I'm not to sure about what I'm doing! What I want, it's to get the template Id and if it's 1046 apply css class1, else apply css class2.
Quick fix: Set ".Template" to lowercase ".GetCurrent().template == " ... as that's the property name in the API call.
Longer fix ... you could add a ContentPlaceHolder around the <div>, then override that in your selected template. This is more the ".NET way" of doing it - also makes your template mark-up cleaner. But that's just personal preference I guess! ;-)
Get template currentNode template Name or Id
Hi guys, I'm trying to get the current node's template name or id to select a diffrent css class.
I'm begining all that stuff, so I'm not to sure about what I'm doing! What I want, it's to get the template Id and if it's 1046 apply css class1, else apply css class2.
It's directly in my master page, and I use 4.7.1.
Thank you for your help!
Hi Profiterole,
Quick fix: Set ".Template" to lowercase ".GetCurrent().template == " ... as that's the property name in the API call.
Longer fix ... you could add a ContentPlaceHolder around the <div>, then override that in your selected template. This is more the ".NET way" of doing it - also makes your template mark-up cleaner. But that's just personal preference I guess! ;-)
Cheers, Lee.
Hi Lee, I got an error about operand == and "int" or "string". I'll try the placeholder idea... that was my first idea too, but I was too lazy!
With the error, try testing it as an 'int' instead of a 'string':
Thank you
is working on a reply...