Bug #94125

Fluid f:render with argument "contentAs" does not work as expected

Added by Gabriel Kaufmann / Typoworx NewMedia 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Fluid
Start date:
2021-05-12
Due date:
% Done:

0%

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

Description

Fluid f:render with argument "contentAs" does not work as expected, as the documentation implies a delegation of the rendered content is always possible to use pre-rendered content in the given variable to output the contents using variable.

But this seems to be broken, as the variable is only set by using another rendering call or a delegate-class. There is no implicit call to VariableContainer setting the variable without these cases.

As known from other ViewHelpers a given "as" argument will return the content/result into that variable instead of implicit rendering.

Usage cases
would be to render a given wrapping HTML only in case the f:render will return a non-empty result.

Code Reference
https://github.com/TYPO3/Fluid/blob/fb42c02cb286f99ac677679f03280b2ad2d2b54e/src/ViewHelpers/RenderViewHelper.php#L145

Feature should be interesting for TYPO3 v9.5 upwards


Files

RenderViewHelper.php.issue-94125.patch (1.06 KB) RenderViewHelper.php.issue-94125.patch Patch for TYPO3Fluid\Fluid\ViewHelpers\RenderViewHelper Gabriel Kaufmann / Typoworx NewMedia, 2021-05-12 12:46

Also available in: Atom PDF