More in this section

Forums / Developing with Sitefinity / SiteFinityImage hard coded border

SiteFinityImage hard coded border

3 posts, 1 answered
  1. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    21 Apr 2010
    Link to this post
    Hi Everyone,

    I'm finishing a SiteFinity website and there is still one thing that doesn't work as it should. The problem is with a SiteFinityImage. By default this control renders style="border-width:0px;" and i don't want that. I want do want a border around my images, but i don't want the CMS user to fill in border settings for every image that he uses. I want to control this with CSS.
    Is there a way to setup the SiteFinityImage to render no hardcoded style property at all? i just want a clean img tag.

    Best regards,
    Tys
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Apr 2010
    Link to this post
    Hello Tys,

    The border is added by ASP.NET Image control from which our control inherits. You could add css classes in your theme to override the style that applies over the image tag by using !important.

    Another option is creating a custom class that inherits from SitefinityImage and overriding  AddAttributesToRender without calling the base and implement your own way for rendering.

    The border is called from the base only when this.BorderWidth is empty.

    Greetings,
    Ivan Dimitrov
    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.
    Answered
  3. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    21 Apr 2010
    Link to this post
    Thanks for your reply. By adding !important the problem is fixed.
Register for webinar
3 posts, 1 answered