TYPO3: Pass multiple arguments to a partial from a fluid template
27,341
Solution 1
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.
Solution 2
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
Related videos on Youtube
Author by
Mateng
PHP & TYPO3 Developer from Cologne, Germany. My most popular answer as voted by Google: What is the best way to debug Typoscript Currently aiming for 2500 reputation points at SO in order to create tag synonyms.
Updated on December 29, 2020Comments
-
Mateng over 3 years
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?