[TYPO3-mvc] Possible to make a section optional?

Nathan Lenz typo3 at k9tfk.com
Thu Jan 7 23:41:57 CET 2010


I have added a new section called "contextualbox" to an existing layout:

<f:render section="content" />
<f:render section="contextualbox" />

However, not all of my views provide content for this because it's new.
 This causes "#1227108982: The given section does not exist!" to be
thrown for all the views that do not define the contextualbox.

I could create an alternate layout and change some of the views to use
this alternate layout IF they decide to define the new section.  This
seems clean enough.


Would it be appropriate to make a section optional so that it is not
required to be defined and provides a default?

So instead of the above, you could do this inside a layout:

<f:render section="contextualbox">
	<p>This is default content for the contextualbox section.</p>
</f:render>

Then if the contextualbox section is not defined by a view, the render
view helper could continue.

Just an idea,
--Nathan Lenz








More information about the TYPO3-project-typo3v4mvc mailing list