Bug #71118
closed$this->cObj->RECORDS($conf) is not HTML5 ready
0%
Description
When I use this small PHP-skript:
$this->cObj = $this->configurationManager->getContentObject(); $conf = array( 'tables' => 'tt_content', 'source' => $uid, 'dontCheckPid' => 1 ); return $this->cObj->RECORDS($conf);
I will get the content element, but some HTML5 tags are encoded. E.g. the figure-tag is encoded.
I looks like this:
<figure class="csc-textpic-image csc-textpic-last">
That is very bad! Whats wrong?
Updated by Kurt Gusbeth about 9 years ago
Sorry: not tested with TYPO3 6.2. Testet with TYPO3 4.7.
Updated by Andreas Kienast about 9 years ago
- Status changed from New to Needs Feedback
- TYPO3 Version changed from 6.2 to 4.7
Does this also happen on 6.2 or master?
Updated by Kurt Gusbeth about 9 years ago
Ok, I have tested it now with TYPO3 6.2.15. Same Problem with figure and figcaption:
<div class="csc-textpic-imagewrap" data-csc-images="1" data-csc-cols="1"> <div class="csc-textpic-center-outer"><div class="csc-textpic-center-inner"><p> <figure class="csc-textpic-image csc-textpic-last"> <img src="fileadmin/user_upload/test.jpg" width="195" height="124" class="img-responsive" style="width:100%;" alt="" /> <figcaption class="csc-textpic-caption">test 123</figcaption></figure> </p></div></div> </div>
Updated by Georg Ringer almost 9 years ago
it seems you are using a wrong approach to render the content in the end!
I guess you are using and some kind of this html snippet
<f:format.html>{content}</f:format.html>
and a TS like
page.10.variables.content < styles.content.get
don't use this approach but a different one:
<f:cObject typoscriptObjectPath="lib.general.content" />
and a TS:
lib.general.content < styles.content.get
please report if that helps
Updated by Kurt Gusbeth almost 9 years ago
Yes, I am using
<f:format.html>{element.bodytext}</f:format.html>
in the template of my extension. Why is that approach bad?
I don´t know, how to translate this PHP-lines to a TypoScript solution:
foreach ($dataArray as $uid => $value) { $conf = array( 'tables' => 'tt_content', 'source' => $uid, 'dontCheckPid' => 1 ); $dataArray[$uid]['bodytext'] = $this->cObj->RECORDS($conf); } $this->view->assign('elements', $dataArray);
Updated by Georg Ringer almost 9 years ago
basically you get exatly what you wanted to have, parsing your record through the htmlparser. as this is configured to not allow figure & co, all those tags are escaped.
better use <f:format.raw>
that should be fine as well.
Updated by Kurt Gusbeth almost 9 years ago
OK. Thank you.
You can close this bug, because it is not a problem of $this->cObj->RECORDS
(it´s a problem of f:format.html).
Updated by Riccardo De Contardi almost 9 years ago
- Status changed from Needs Feedback to Closed
Thank you for your feedback, I'll close this.
<f:format.raw>
is the correct way to parse a whole record object; see also https://wiki.typo3.org/T3Doc/Fluidtemplate_by_example