[TYPO3-mvc] A layout/template structuring question

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Oct 20 10:23:43 CEST 2010


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
-----------------------------------------------

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list