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

Forums / Designing with Sitefinity / Strip all inline stylesheet

Strip all inline stylesheet

9 posts, 0 answered
  1. Rene
    Rene avatar
    25 posts
    Registered:
    02 Feb 2009
    09 Dec 2009
    Link to this post
    Hi,

    I have a question regarding inline stylesheet. If I add content to a page and for example add an image and change some settings of the image, the code that is generated uses inline stylesheet. Is there a way to remove all the inline stylesheet? Or is there a possibility that if you change the settings code is generated in the stylesheet? We are using Sitefinity3.7, so I am not sure if this at all will be possible.

    I look forward seeing some information and hopefully a solution.

    Thanks in Advance
    Rene Janssen
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Dec 2009
    Link to this post
    Hello Rene,

    Thank you for using our services.

    Do you mean removing the embedded styles for Sitefinity content view controls such as the News View? If yes, you can check out this forum thread - News View Control


    Regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Rene
    Rene avatar
    25 posts
    Registered:
    02 Feb 2009
    17 Dec 2009
    Link to this post
    What I actually mean is when you add an image and change some properties (like a border vor example), inside the html-code the style is embedded in the tag. For example <img src="..." style="border:0px;">. Is there a way that the style is included in the CSS files instead of in the HTML-tag?

    Rene
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Dec 2009
    Link to this post
    Hi Rene,

    Instead of putting the style in the tag you can assign the tag a class name. Then in your theme you will apply rules for this class name. E.g. <img src="..." class="MyClass" /> then in the theme style you can add:
    .MyClass
    {
        border: 0px;
        }

    This should do the trick.

    All the best,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Rene
    Rene avatar
    25 posts
    Registered:
    02 Feb 2009
    17 Dec 2009
    Link to this post
    Hi Radoslav,

    Well, it is not me who adds the style inside the tag, but it is generated by Sitefinity. If you add an image, you can change the proporties. If you change a proporty Sitefinity adds the style inside the tag. Maybe I overlook something, or maybe I do something wrong??

    Rene
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Dec 2009
    Link to this post
    Hello Rene,

    Well, this is how the the editor control is designed. However, you do have an option to apply a CSS class to the image inserted. Please take a look at the attached image. To add your custom Css Classes to the drop down for applying a CSS class you have to do the follwoing.

    1) Download the external templates archive for your version of Sitefinity
    2) Map the templates for controls where you want these styles appearing. For example for creating and editing news control templates are located in ~/Sitefinity/Admin/ControlTemplates/News/ and are called NewsItemNew.ascx and NewsItemEdit.ascx. In those templates the RadEditor control has a property EditorCssFile set to point to an empty CSS file:
    <CssFiles>
        <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" />
    </CssFiles>

    You can add your styles to this file, and then to your theme. More information on how to map external templates can be found here. A forum thread explaining the process: Limiting Styles in the Editor

     
    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Rene
    Rene avatar
    25 posts
    Registered:
    02 Feb 2009
    17 Dec 2009
    Link to this post
    Radoslav,

    Thanks! I will pass it on to my colleagues, I understand the solution, it is only a but tricky for our customers, because they will not have access to the css files, because most customers don't understand css. But we will find a solution, thank you very much.

    Rene
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Dec 2009
    Link to this post
    Hello Rene,

    Thank you for the feed back.

    Once you populate the dropdown with CSS your customers do not need access to the Css files. They only need to apply the class.

    Looking forward for an update on this.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Rene
    Rene avatar
    25 posts
    Registered:
    02 Feb 2009
    17 Dec 2009
    Link to this post
    Radoslav,

    I will keep you informed.

    Rene
Register for webinar
9 posts, 0 answered