Thomas BP
Thomas BP

Reputation: 1227

remove autogenerated DIVs in TYPO3

Have search the net and can't find a solution. If im make a page in TYPO3 and add some content, i end up with this.

<div id="clear"> </div>


    <!--  CONTENT ELEMENT, uid:4/html [begin] -->
        <div id="c4" class="csc-default">
        <!--  Raw HTML content: [begin] -->
            <div id="topbilled_om"></div>
        <!--  Raw HTML content: [end] -->
            </div>
    <!--  CONTENT ELEMENT, uid:4/html [end] -->


    <!--  CONTENT ELEMENT, uid:2/html [begin] -->
        <div id="c2" class="csc-default">
        <!--  Raw HTML content: [begin] -->
            <div id="LeftColumn">

And what i want is this

    <div id="clear"></div>
    <div id="topbilled_om"></div>
    <div id="LeftColumn"></div>

How do i skip the extra added div's, my problem is that its make an error in my design, bc of the extra added div's ?

Upvotes: 2

Views: 8865

Answers (3)

cweiske
cweiske

Reputation: 31068

With TYPO3 7.6 and an enabled fluid_styled_content extension, this comes from fluid_styled_content/Resources/Private/Layouts/ContentFooter.html.

You have to add your own layout path in typoscript:

lib.fluidContent.layoutRootPaths.100 = EXT:foo/Resources/Private/Layouts/

and then copy and adjust the ContentFooter.html file in your extension.

Upvotes: 5

biesior
biesior

Reputation: 55798

To remove comments disable them in your TS template:

page.config.disablePrefixComment = 1

To disable csc-* frames you can set it manually to the No frame on Appearance tab of each tt_content or better just set it as default with PageTS of root page:

TCAdefaults.tt_content.section_frame=66

Finally you can just overwrite whole CSC (CSS Styled Content) in your own template to remove unwanted wraps.

Upvotes: 1

lorenz
lorenz

Reputation: 4558

You can delete the innerWrap of a cObject:

tt_content.stdWrap.innerWrap >

Yet I do not recommend it. It looks like you're trying to use HTML element as some kind of placeholders. You could use a field like "layout" (in the page properties) to define custom wraps instead of csc-default, e.g.:

tt_content.stdWrap.innerWrap.cObject = CASE
tt_content.stdWrap.innerWrap.cObject {

  key.field = layout

  1 = TEXT
  1.value = <div class="my-layout-1">|</div>

  2 = TEXT
  2.value = <div class="my-layout-2">|</div>

}

and rename the layout in the backend:

TCEFORM.tt_content {
  layout.altLabels.1 = My Layout 1
  layout.altLabels.2 = My Layout 2
}

Upvotes: 4

Related Questions