SaaS CMS has officially launched! Learn more now.

Extra Divs in ContentArea


I have the following ContentArea Propety on my page:

            GroupName = SystemTabNames.Content,
            Name = "Main Content",
            Order = 10)]
        public virtual ContentArea MainContent { get; set; }


And in my template file, I have

@Html.PropertyFor(x => x.MainContent)


To output the blocks..

What's really strange is I am getting a <div><div> (double divs) wrapping any of the blocks that are added.. I have no idea where these are coming from.
Can anyone suggest anything please?


Mar 05, 2014 18:05

It appears that it wraps all items in an outer div, and each item in it's own div (hence opening and closing double divs?)

Looks like it's answered in

My issue is it's adding the extra mark up for my <ul> lists:


so, I have

    <!-- start block items -->
        <!--block -->
        <!--end block>
        <!--block -->
        <!--end block>-->
        <!-- end block items -->


I'd prefer the extra divs removed, but I can see if the css dev cna update his css to display content correctly in that format

Edited, Mar 05, 2014 18:08

You should be able to use customtag and childrentag for this.


@Html.PropertyFor(x => x.Rotator, 
            ChildrenCustomTagName ="li", 
            ChildrenCssClass = "rotator-item"
Mar 05, 2014 20:25

You could always create a custom content area that doesn't render the divs in live mode  If you only need to do this once or twice on your project then it's a bit overkill and I would go with the usin gthe ChildrenCustomTagName.  I fyou are interested in how to remove the div's via a custom content area I  wrote a blog post about it Extra divs in content area how to remove them ?

Aug 07, 2015 12:07
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.