Project

General

Profile

Actions

Bug #71118

closed

$this->cObj->RECORDS($conf) is not HTML5 ready

Added by Kurt Gusbeth about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-10-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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?

Actions #1

Updated by Kurt Gusbeth about 9 years ago

Sorry: not tested with TYPO3 6.2. Testet with TYPO3 4.7.

Actions #2

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?

Actions #3

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>
  &lt;figure class=&quot;csc-textpic-image csc-textpic-last&quot;&gt;
  <img src="fileadmin/user_upload/test.jpg" width="195" height="124" class="img-responsive" style="width:100%;" alt="" />
  &lt;figcaption class=&quot;csc-textpic-caption&quot;&gt;test 123&lt;/figcaption&gt;&lt;/figure&gt;
 </p></div></div>
</div>

Actions #4

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

Actions #5

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);

Actions #6

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.

Actions #7

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).

Actions #8

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

Actions

Also available in: Atom PDF