Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TYPO3: Pass multiple arguments to a partial from a fluid template

I have a fluid template, from where I call an often used snippet (called "partial"):

Template:

<f:render partial="fbLikeBox" arguments="{settings}"/>

Partial fbLikeBox.html:

<div id="fb-root"></div><script src="http://connect.facebook.net/xxxxxxxx"></script>
<fb:like href="{settings.baseURL}/details/?guide_uid={audioguide.uid}">
</fb:like>

As you can see, I need both values from the {settings} and the {audioguide} array passed to the partial. How can I achieve that?

like image 262
Mateng Avatar asked Oct 05 '11 22:10

Mateng


Video Answer


2 Answers

Starting with TYPO3 4.6, you could just use

<f:render partial="fbLikeBox" arguments="{_all}" />

The {_all} will simple make sure all variables currently available in your template, are available in the partial.

like image 172
Jan-Erik Revsbech Avatar answered Sep 20 '22 13:09

Jan-Erik Revsbech


you can use an array, like:

<f:render partial="fbLikeBox" arguments="{settings : settings, audioguide:audioguide}"/>

They're key : value pairs where the value defines the accessible name in your partial

like image 28
konsolenfreddy Avatar answered Sep 21 '22 13:09

konsolenfreddy