Hi Marcus,
I've also experienced this but I'm sorry to say that i don't know any solution for it. I am also looking for a solution so if you managed to find anything let me know.
Hi Thomas,
The solution we came up with (or rather "quick-fix") was to use jQuery to remove the empty DIV-tag.
Hmmm, using javascript doesn't really cut it for me. Tried to solve it using inheritance and overrides on the render methods but without success. Anybody found a solution yet?
Hi, I realise this thread is very old, but did anyone ever find a solution or workaround (non-Javascript based) to resolve this?
I think I've found both the solution and the cause...
It's possibly being caused by the holder panel in the ExtensionContentArea control rendering when in non-edit mode. This could be resolved by EPiServer using a PlaceHolder instead of a Panel.
To fix it, you can attach the following pre-render handler to your ExtensionContentArea's which will hide the holder panel in non-edit mode.
private static Lazy HolderGetter = new Lazy(() =>
{
var type = typeof(ExtensionContentArea);
var field = type.GetMember("_holder", MemberTypes.Field, BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.Instance).FirstOrDefault() as FieldInfo;
return field;
});
internal static void ExtensionArea_PreRender(object sender, EventArgs e)
{
var extensionArea = sender as ExtensionContentArea;
if (extensionArea != null && HolderGetter.Value != null)
{
var holder = HolderGetter.Value.GetValue(extensionArea) as Control;
if (holder != null && extensionArea.Holder != holder)
{
holder.Visible = false;
}
}
}
If you're particularly tricky, you may be able to attach it to your page's ExtensionPageHandler's LoadContentArea event to make sure you get your pre-render handler onto them all...
Hi,
In our Composer Layout blocks we've noticed that Extension:ExtensionContentArea renders an empty DIV as its end-tag:
<!-- Start Composer Layout block -->
<!-- Start Composer Content block -->
Content goes here
<!-- End Composer Content block -->
<div> </div>
<!-- End Composer Layout block -->
Has anyone else experienced this, and if so, how can it be avoided?
//Marcus