[TYPO3-mvc] creating nodes in FLUID - how to?

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Feb 4 13:27:16 CET 2010


Hi Martin,

> I've been playing a bit with the widget idea and came cross Franz's request to generate children on
> the fly. In the example I have chosen "repeat for" to use a natural language construct different
> from "for each". The main difference between them is that for-each will render it's children, but
> repeat-for will create nodes to be rendered by its parent.
>
> <f:widget.tabs>
>   <f:widget.tab title="static tab">
>     Foo bar
>   </f:widget.tab>
>   <f:repeat for="{objects}" as="object">
>    <f:widget.tab title="{object.title}">
>     {object.description}
>    </f:widget.tab>
>   </f:template>
> </f:widget.tabs>
>
> Does this make sense?

Not sure what you're expecting from this. If you're iterating over the 
objects, why can't the widget itself do that for you?

<f:widget.tabs items="{objects}" as="item">
	<f:widget.tab title="{item.title}">
		{item.description}
	</f:widget.tab>
</f:widget.tabs>

ok - that way you can't add additional tabs - hmm. Maybe the widget.tab 
needs some additional parameter that tells the widget to use exactly 
this tab for iteration? And what if you need stuff like even/odd or the 
iterator count/cycle inside the tabs? Widgets might become more 
complicated to do then I thought.

Yesterday I was building a pagination widget/viewHelper and also came 
across some limitations in FLUID that I bypassed for now as I didn't 
need them for the current task.


-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list