Я комбинирую объект TypoScript CONTENT с гибким шаблоном.
В шаблоне страницы:
<f:cObject typoscriptObjectPath="lib.myItem" />
In TS:
lib.myItem = CONTENT
lib.myItem {
table = tt_content
select.where = colPos = 0
select.languageField = sys_language_uid
renderObj = FLUIDTEMPLATE
renderObj {
file = {$customContentTemplatePath}/Myfile.html
layoutRootPath = {$customContentLayoutPath}
partialRootPath = {$customContentPartialPath}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10.references.fieldName = image
}
}
}
В Myfile.html:
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<div class="small-12 medium-6 large-4 columns">
<f:for each="{files}" as="file">
<v:media.image src="{file}" srcset="1200,900,600" srcsetDefault="600" alt="{file.alternative}" treatIdAsReference="1"/>
</f:for>
<div class="fp-ql-txt">
{data.header} >
</div>
</div>
Но теперь я понял, что, поскольку шаблон применяется renderObj для каждого элемента содержимого, у меня нет доступа к информации о каждой итерации для каждой жидкости. Итак, я не могу этого сделать:
<f:for each="{data}" as="item" iteration="itemIterator">
{itemIterator.cycle}
</f:for>
чтобы узнать, в каком из отображаемых элементов мы находимся ... потому что каждый элемент отображается индивидуально с помощью renderObj
.
Как я могу получить информацию об итерации продуктов renderObj? Только в TS со старыми и ужасающими счетчиками, как в http://typo3-beispiel.net/index.php?id=9?