+1-888-365-2779
Try Now
More in this section

Forums / Suggestions / Add a class to a page

Add a class to a page

2 posts, 0 answered
  1. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    21 Nov 2012
    Link to this post
    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.
  2. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    23 Nov 2012
    Link to this post
    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
2 posts, 0 answered