chrona
chrona

Reputation: 1911

Remove autogenerated HTML in typo3

Trying to get into typo3; unfortunately the docs aren't really helpful for me. After creating a backend-layout I am trying to output multiple columns.

Right now I'm getting the following output:

<div id="c23" class="frame frame-default frame-type-text frame-layout-0">
    <a id="c30"></a>
    <header>
        <h2 class="">Title</h2>
    </header>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed …</p>
</div>

I'd like to have the output without any extra elements, like this:

<h2>Title</h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed …</p>

What is the correct way to get the "correct" output in typoscript?

Upvotes: 1

Views: 1945

Answers (3)

Predrag Mitrovic
Predrag Mitrovic

Reputation: 51

If is TYPO3 7.6

Yo need to override boostrap-package Layouts/ContentElements/Default.html

because there are created that classes and from that files remove wrapper div id="c{data.uid}" class="frame frame-type-{data.CType} frame-layout-{data.layout} {sectionClass}"

Only wrapper!

Upvotes: 2

jokumer
jokumer

Reputation: 2269

Such HTML attributes comming from EXT:fluid_styled_content (/typo3/sysext/fluid_styled_content/Resources/Private/Layouts/Default.html). To adapt this and all other files, you should make a copy of folders Templates, Partials, Layouts from /typo3/sysext/fluid_styled_content/Resources/Private, define them via typoscript constants as new paths:

styles.templates {
    templateRootPath = [PATH/TO/YOUR/FOLDER/Templates]
    partialRootPath = [PATH/TO/YOUR/FOLDER/Partials]
    layoutRootPath = [PATH/TO/YOUR/FOLDER/Layouts]
}

and adpat them for your needs, especially /PATH/TO/YOUR/FOLDER/Layouts/Default.html This is best done in a recommended own sitepackage. You could use https://sitepackagebuilder.com/new/ to start with.

Upvotes: 4

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

with FSC (fluid_styled_content) all your markup is in fluid-templates, which you can override.
go to your server and copy files from (webroot)/typo3/sysext/fluid_styled_content/Resources/Private/ + Layouts/ and/or Partials/ and/or Templates/.
In typoscript setup you need to define additional pathes to your variants.

Don't copy all files, but copy only those you modify.
In your case you probably need to modify the Layouts/* and Partials/header.

Upvotes: 1

Related Questions