More in this section
Forums / Designing with Sitefinity / CssClass on Generic Content module not working

CssClass on Generic Content module not working

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. James@Nw
    James@Nw avatar
    265 posts
    05 May 2009
    23 Feb 2010
    Link to this post
    Hi Guys,

    I am trying to add a CssClass to a generic content block which I drop onto my page but when I publish the page, the CssClass name is not picked up. Is there something preventing this on Generic Content areas?

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    23 Feb 2010
    Link to this post
    Hello James,

    Thank you for using our services. 

    Unfortunately the Generic Control renders the contents straight to the page's markup. It is not wrapped into a container div for example which can take the css class name. You have two options if you wish to do this:

    1) when creating generic content go to html mode and wrap the whole content into a div with class name (not applicable to non technical users)

    2) Create a control which inherits from generic content. This control will render the content of the control within a containing div. Then you can simply set this div to have a class name define rules for it. Sample on this can be found here: How to wrap a Generic Content Control

    I would recommend the second option as you only need to apply this once.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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