Adding [TabName] as a Class on the Body Tag

Mar 23, 2016 at 9:09 PM
Edited Mar 23, 2016 at 9:10 PM
I like how you have [BcName] and [BcId] to add as classes on the body Tag.
However, I needed something a little cleaner. I wanted to be able to add just the TabName without any prefixed level Id.

I needed a clean
<body class="Home">
//or
<body class="About">
//or
<body class="Contact_Us">
So, I added a new Token to the _sBodyClass token string list called [TabName].
and then the following to Sub ProcessPageClassTemplate
'Get TabName Class
If Regex.IsMatch(Template, "\[TabName\]", RegexOptions.IgnoreCase) Then
  sOut &= " " & CreateValidCssClass(PortalSettings.ActiveTab.TabName)
  Template = Regex.Replace(Template, "\[TabName\]", sOut, RegexOptions.IgnoreCase)
End If
Can you please add this into the next build, I have found it extremely useful, and I image other would as well.

Thanks, love this module!
Coordinator
Mar 26, 2016 at 10:01 AM
Hi Bard,

Good idea :-)
I added similar functionality to the release I have in preparation..(02.09.00)
But I have not been able to finish it yet.
BTW in the new release the toke will be: [Page:Name]

I also added some other option too:

[Portal:Id], [Portal:Alias], [Page:Name], [Page:Title], [Page:Description], [Page:Url], [Page:RelativeUrl], [Page:Id], [Page:Skin], [Page:Container]

Which can be used in both the BodyClass, but also Content, AddtoHead etc.

I hope to release the new version in the coming weeks.
Thanks for the feedback.

Timo
Mar 28, 2016 at 3:52 PM
Sounds great, thanks!
Coordinator
Jun 6, 2016 at 3:34 PM
Took me a while, but the Beta is there: https://stylehelper.codeplex.com/releases/view/624208