4

Should be simple enough. I'm trying to add an input field to a fluid partial in the extension "yag" (yet another gallery).

Input: <f:form.textfield id="live-filter" name="test" />

Output: &lt;input id=&quot;live-filter&quot; type=&quot;text&quot; name=&quot;test&quot; /&gt;

Somehow the code get's filtered along the way, but I don't know why. TYPO3 v. 6.2

YAG v. 3.2.1

Edit: A wild guess would be some output filtering in TYPO3 itself, but where? I didn't set anything by purpose.

Florian Rachor
  • 1,574
  • 14
  • 31

3 Answers3

3

You need to traverse the path upwards to check if there is any fluid tag wrapped around it, that does escaping. In general, all tags do escaping. Also check the code around <f:render partial....

It could also be that the TypoScript code that does calls the fluid template, has a .htmlspecialchars = 1 set.

pgampe
  • 4,531
  • 1
  • 20
  • 31
2

Since TYPO3 8 there is another pitfall: Custom Viewhelpers do htmlspecialchars on the output unless told otherwise. The solution is:

<?php
namespace Vendor\ArTest\ViewHelpers;

class YourViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper{

  /**
    * As this ViewHelper renders HTML, the output must not be escaped.
    *
    * @var bool
    */
  protected $escapeOutput = false;
Markus
  • 119
  • 4
2

As of TYPO3 ver. 9.5 and up to ver. 10.4 you could also wrap the output in the Fluid template into <f:format.htmlentitiesDecode> Tags like this:

<f:format.htmlentitiesDecode>
    <f:form.textfield id="live-filter" name="test" />
</f:format.htmlentitiesDecode>

Further information on this can be found in the TYPO3 View Helper Reference.

digijay
  • 1,329
  • 4
  • 15
  • 25