Try our conversational search powered by Generative AI!

Extra Divs in ContentArea

Vote:
 

I have the following ContentArea Propety on my page:

        [CultureSpecific]
        [Editable(true)]
        [Display(
            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?

Thanks
Danny

#82128
Mar 05, 2014 18:05
Vote:
 

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 http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=69955

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

 

so, I have

<ul>
    <!-- start block items -->
    <div>
        <!--block -->
        <div>
            <li>{content}</li>
        </div>
        <!--end block>
        <!--block -->
        <div>
            <li>{content</li>
        </div>
        <!--end block>-->
        <!-- end block items -->
    </div>
</ul>

    

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

#82130
Edited, Mar 05, 2014 18:08
Vote:
 

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

 

@Html.PropertyFor(x => x.Rotator, 
    new
        {
            ChildrenCustomTagName ="li", 
            ChildrenCssClass = "rotator-item"
        })
#82136
Mar 05, 2014 20:25
Vote:
 

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 ?

#131872
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.