typo3 - Get next news record in Fluid Template? -
i creating custom news template tx_news uses fluid template.
i need uid of next news record in loop.
<f:for each="{news}" as="newsitem" iteration="iterator"> <div id="{newsitem.uid}"> <a href="#{newsitem.next.uid???}">go next</a> </div> </f:for>
you use extension vhs
, provides ton of useful viewhelpers - among them viewhelper v:iterator.next
. i've never used it, reading documentation i'd use (using viewhelper v:variable.set
same extension creating local variable):
{namespace v=fluidtypo3\vhs\viewhelpers} <f:for each="{news}" as="newsitem" iteration="iterator"> <div id="{newsitem.uid}"> <v:variable.set name="nextnews" value="{news -> v:iterator.next(needle: newsitem)}"/> <a href="#{nextnews.uid}">go next</a> </div> </f:for>
Comments
Post a Comment