[TYPO3-mvc] A layout/template structuring question

Henrik Møller Rasmussen info at hmrdesign.dk
Wed Oct 20 10:25:28 CEST 2010


On 20/10/10 10.23, Franz Koch wrote:
> Hey,
>
>> I imagine the layout.html can be used - something like this:
>>
>> --- snip ---
>> <div id="sidebar">
>> SIDEBAR
>> </div>
>> <div id="catalog-content">
>> <f:render section="content" />
>> </div>
>> --- snip ---
>>
>> But how can I render the sidebar-content? Alternatively I could use
>> partials in each view to render the sidebar, but that also seems wrong
>> to me.
>>
>> I have looked at the blog_example but could not find anything like this
>> there. Hope someone can point me in the right direction, and any help is
>> very appreciated.
>
> I'd do the following:
>
> -- layout sidebar.html ---------------------------------
> <div id="sidebar">
> <f:render section="sidebar" />
> </div>
> <div id="catalog-content">
> <f:render section="content" />
> </div>
>
> -- templateXY.html -------------------------------
> <f:layout name="sidebar" />
> <section name="sidebar">
> <f:render partial="sidebar" arguments="{foo:bar, settings:settings}" />
> <!-- if needed you could add additional content depending on the view -->
> </section>
> <section name="content">
> ...
> </section>
>
> -- Partial sidebar.html -----------------------
> your rendering setup
> -----------------------------------------------
>


Thanks Franz -- I had thought about that solution, but just needed a 
confirmation that it was the way to do it ;-)

Have a nice day.

- Henrik


More information about the TYPO3-project-typo3v4mvc mailing list