Project

General

Profile

Actions

Feature #77276

closed

Pass the content of a f:render tag to the child

Added by Daniel Corn over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-07-28
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

I think it would be handy if the content of a f:render tag could be passed on to the child.

Example:

<!-- Parent section -->
<f:section name="main">
    <f:render section="child">
        <h1>This will be passed as a special variable to the child</h1>
        <p>More important text</p>
        <img />
    </f:render>

    <f:render section="child">
        <h1>Render the child with another content</h1>
        <p>More important text</p>
        <img />
    </f:render>
</f:section>

<!-- Inside the partial/section -->
<f:section name="child">
<div class="my-container">
    <!-- other complex markup -->

    {content} <!-- Insert the passed content here -->

    <!-- other complex markup -->
</div>
</f:section>

Use case:

I made a subclass of the RenderViewHelper which allowed me to pass a complex HTML content to the partial.

<!-- Parent section -->
<f:section name="main">
    <f:render partial="DateWrapper" section="main">
        <!-- Invoke the date rendering from calendarize -->
        <f:render partial="Event/Date" section="main" arguments="{index: index}"/>
    </f:render>

    <!-- more stuff -->

    <f:render partial="DateWrapper" section="main">
        <!-- Reuse the DateWrapper with other content  -->
        <f:format.date>{today}</f:format.date>
    </f:render>
</f:section>
Actions #1

Updated by Markus Klein over 8 years ago

  • Status changed from New to Needs Feedback
Actions #2

Updated by Daniel Corn over 8 years ago

Than I'm sorry for opening a ticket!

Actions #3

Updated by Riccardo De Contardi over 8 years ago

@Daniel Hinderink: so, do you agree if I close this one? Thank you

Actions #4

Updated by Daniel Corn over 8 years ago

Yes, please close it.

I see, you folks are faster than me with new innovations ;)

Actions #5

Updated by Riccardo De Contardi over 8 years ago

  • Status changed from Needs Feedback to Closed

Closed as already resolved. Thanks for the quick response

Actions

Also available in: Atom PDF