TYPO3 : send data from extension to the backend layout

Viewed 49

I made an extension which display some data and I need to send them to my Layout.

In my file list.html I made a left column with some data, but finally I need this column in my layout.

there is some code :

Layouts/MyLayout.html

<f:render partial="Structure/Header" arguments="{_all}"/>
<f:render partial="Menus/Main" arguments="{_all}"/>
<!--the left column should be here -->
<f:render section="default" />

List.html

<f:layout name="Default"/>
<f:section name="main">
<aside>
        <h2>Title</h2>
        <ul>
            <f:for each="{Mydata}" as="data">
                <li>{data.title}</li>
            </f:for>
        </ul>
</aside>
</f:section>

That's why I would need to retrieve my extension data in my layout. It is possible to get I ?

If it's not possible, it is possible to get in list.html the name of the actual backend layout with some typoscript ?

1 Answers

There are multiple options to handle whether there are data for an additional column in layout.

first:
Even if in FLUID the files are stored in three folder (Layouts/, Partials/, Templates/) you are not forced to use it in that way. Meaning: you also can decide the layout in the template files.

In the default layout you just render a mainsection (from the template file). And in the different templates you decide whether a side column exist.

second:
extension data can be provided in multiple ways:

You can do the rendering completely in typoscript - or you use a content element with a plugin. The later would be more transparent for editors.
In your case you can provide a different BackEnd layout where editors can put a plugin in the additional column for that special 'layout'. The rendering only occurs if that 'layout' is selected and a plugin is stored in that column.

Related