Bug #71118
closed
$this->cObj->RECORDS($conf) is not HTML5 ready
Added by Kurt Gusbeth about 9 years ago.
Updated almost 9 years ago.
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?
Sorry: not tested with TYPO3 6.2. Testet with TYPO3 4.7.
- 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?
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>
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
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);
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.
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).
- Status changed from Needs Feedback to Closed
Also available in: Atom
PDF