Add a class to a page

Posted by Community Admin on 05-Aug-2018 18:10

Add a class to a page

All Replies

Posted by Community Admin on 21-Nov-2012 00:00

It would be nice to be able to add a class to the body tag of a page and also have that class be added to the menu item in the navigation.
Such as having the option when creating the page and not having to add JQuery to do it. Especially for the navigation (because the text or position of the item may change) 
So for instance if you want to highlight a particular page in the navigation, if it had a class assigned to it, you could style it differntly than the rest....
Thanks.

Posted by Community Admin on 23-Nov-2012 00:00

Hi Laura,

Actually, if you're using a master page as template for your pages, you can set a css class to the body of the page. However, I would recommend you to use the sfPublicWrapper class when setting css styles to the page, since the div with this class actually holds the whole content of the page. 

I'm not sure I understand your second requirement:

Such as having the option when creating the page and not having to add JQuery to do it. Especially for the navigation (because the text or position of the item may change).

Could you please elaborate a bit on it?

As for the class, which should be set to the navigation item, when particular page is opened - this feature is offered out-of-the-box. Depending on the type of navigation control you're using, it varies between rtsSelected and rmSelected (when the navigation is based on RadTabStrip and RadMenu respectively). 

All the best,
Jen Peleva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed