Can sfimageWrp be removed?
We have noticed when we add an Image content to a Page or PageTemplate it adds an extra div tag (see below)
<div class="sfimageWrp">
Is there a way to override this or not have the div class generated for images?
We tried to remove the sfimageWrp fro the CssClass in the Image advanced properties, but it keeps adding it when the page html is generated.
Hey Mike,
Hey guys,
There's something else you can do, though I have to admit that's a nice trick, @Jochem :). @Mike, you can create a custom Image widget, which inherits from the default one and in its code -behind simply override two methods - RedredBeginTag and RenderEndTag. This should be enough to remove the div. Take a look at the sample below:
namespace
SitefinityWebApp.Controls
public
class
ImageWidget: ImageControl
public
override
void
RenderBeginTag(System.Web.UI.HtmlTextWriter writer)
if
(!
string
.IsNullOrEmpty(
this
.CssClass))
writer.AddAttribute(HtmlTextWriterAttribute.Class,
this
.CssClass);
public
override
void
RenderEndTag(System.Web.UI.HtmlTextWriter writer)
Jen,
That is exactly what I did and it works. Thank you.