I’ve a very strange behavior and a question for TYPO3 experts: Some HTML tags are not rendered, the output is like: <form enctype="multipart/form-data" />
But only with the tags <form>, <input>, <label>, <figure>
All the other tags <div>, <p>, <span>, <button>, <h2>, even <script>
are working perfectly.
Btw. it has nothing to do with <f:format.html> or <f:format.raw>
because I don’t have an output from the system, it’s directly in the template.
Here is my template:
<html xmlns:f="https://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<f:flashMessages />
<figure class="test">NOT working - tags rendered as text</figure>
<form action="">NOT working - tags rendered as text</form>
<div class="employees">working</div>
<p class="paragraph">working</p>
</f:section>
Another interesting thing is: The problem also occurs with the official “form” extension from TYPO3 8.7! Exactly the same problem, the mentioned tags are not rendered as HTML!
I hope somebody can help me with this problem. I’m getting crazy with this.
Environment
- TYPO3: 8.7.22
- PHP: 7.2
- Extensions: realURL, DCE, Extensions Builder,
Grid Elements, VHS Fluid ViewHelpers, Yoast SEO, news
— update: added TypoScript and layout file —
TypoScript my extension (generated by the Extension Builder)
plugin.tx_rmdataschulungen_rmdataschulungen {
view {
templateRootPaths.0 = EXT:rmdata_schulungen/Resources/Private/Templates/
templateRootPaths.1 = {$plugin.tx_rmdataschulungen_rmdataschulungen.view.templateRootPath}
partialRootPaths.0 = EXT:rmdata_schulungen/Resources/Private/Partials/
partialRootPaths.1 = {$plugin.tx_rmdataschulungen_rmdataschulungen.view.partialRootPath}
layoutRootPaths.0 = EXT:rmdata_schulungen/Resources/Private/Layouts/
layoutRootPaths.1 = {$plugin.tx_rmdataschulungen_rmdataschulungen.view.layoutRootPath}
}
persistence {
storagePid = 106{$plugin.tx_rmdataschulungen_rmdataschulungen.persistence.storagePid}
#recursive = 1
}
features {
#skipDefaultArguments = 1
ignoreAllEnableFieldsInBe = 0
requireCHashArgumentForActionArguments = 1
}
mvc {
#callDefaultActionIfActionCantBeResolved = 1
}
}
Layout file (generated by the Extension Builder)
<html xmlns:f="https://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div class="tx-rmdata-schulungen">
<f:render section="content" />
</div>
</html>
TypoScript (output page content)
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
templateName = Default
templateRootPaths.1 = fileadmin/Resources/Private/Templates/Page
variables {
content < styles.content.get
nav < Navigation
searchbox < lib.searchField
}
}
2
Answers
I solved my problem: The problem was indeed
<f:format.html>
BUT in the main template.I always edited my extension template -> but with
<f:format.raw>
in my website template (for the general output) everything works fine (although I don’t understand why this special behavior regarding the HTML tags occurs).You shouldn’t use the concept of variables for such dynamic content because of not only this issue.
Check out this question and my answer for a detailed feedback