Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to use wrapper-sections in Layout(s) #280

Open
InvisibleKind opened this issue Apr 18, 2017 · 1 comment
Open

Not possible to use wrapper-sections in Layout(s) #280

InvisibleKind opened this issue Apr 18, 2017 · 1 comment

Comments

@InvisibleKind
Copy link

Hi,

I wanted to utilize the feature, which makes it possible to use sections as wrappers.

Here is my Layouts/Default.html:

<f:render section="ContentWrap" contentAs="contentVariable">
	<b>hello</b>
</f:render>

Templates/Main.html

<f:section name="ContentWrap">
	<div class="my-class">
		{contentVariable}
	</div>
</f:section>

But {contentVariable} is always null.
After some debugging I found the troublemaker: \TYPO3Fluid\Fluid\View\AbstractTemplateView and exactly this part:

if ($this->getCurrentRenderingType() === self::RENDERING_LAYOUT) {
    // in case we render a layout right now, we will render a section inside a TEMPLATE.
    $renderingTypeOnNextLevel = self::RENDERING_TEMPLATE;
} else {
    $renderingContext = clone $renderingContext;
    $renderingContext->setVariableProvider($renderingContext->getVariableProvider()->getScopeCopy($variables));
    $renderingTypeOnNextLevel = $this->getCurrentRenderingType();
}

So, no variables are passed in case of rendering section inside of layout. If I simply add $renderingContext->setVariableProvider($renderingContext->getVariableProvider()->getScopeCopy($variables)); in if-section, everything works as expected.

The question: is it bug or made for purpose so?

@s2b
Copy link
Contributor

s2b commented Nov 24, 2023

#469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants