typo3 tt_news 配置列表模板

typo3 tt_news configurate list template

我使用 tt_news 插件来显示新闻。有这样的列表模板

<!-- ###TEMPLATE_LIST### begin -->
<div class="col-md-9">
    <!-- ###CONTENT### begin -->
    <!-- ###NEWS### begin -->
   <div class="single-post-item wow fadeInLeft" style="visibility: visible; animation-name: fadeInLeft;">
       <div class="row mt-4">
           <div class="col-6">
               <h5><span class="border-btm">###NEWS_AUTHOR###</span></h5>
           </div>
           <div class="col-6 text-right">
               <span class="exclu fw-700 text-uppercase bg-red text-white">Exklusiv</span>
           </div>
       </div>
       <div class="row">
           <div class="col-12">
               <div class="post-contents">
                   <h2 class="mb-4">###NEWS_TITLE###</h2>
                   <div class="row">
                       <div class="col-md-6"><!--###LINK_ITEM###-->###NEWS_IMAGE###<!--###LINK_ITEM###--></div>
                       <div class="col-md-6">
                           <p class="m-0 mt-3 mt-md-0">###NEWS_SUBHEADER###
                               <!--###LINK_ITEM###-->mehr...<!--###LINK_ITEM###-->
                           </p>
                       </div>
                   </div>

               </div>
           </div>
       </div>
   </div>
    <!-- ###NEWS### end-->
    <!-- ###CONTENT###  end -->
    ###BROWSE_LINKS###
</div>
<!-- ###TEMPLATE_LIST### end -->

例如,我需要对第一个列表元素进行不同的设计。但是那里没有循环,我无法检查迭代次数。任何想法我该怎么做? TYPO3 8.7,提前谢谢

查看手册并搜索 alternatingLayouts:

Indicates how many alternating designs the news-script should expect in the html-template.

Example: If you define a subpart like: "<!--###NEWS###--> ... <!--###NEWS###-->" this is used all the time. If you define a similar subpart: "<!--###NEWS_1###--> ... <!--###NEWS_1###-->" which might show another set of colors, this is used every second time instead of the default! This is because "alternateLayouts" is set to 2. If you define a similar subpart "<!--###NEWS_2###--> ... <!--###NEWS_2###-->" ... this will be used every third time IF (!) "alternateLayouts" is set to 3. If you do not set it to 3, the first two aternating designs will be used only.

tt_news manual

如果你想要一个不同的模板,而不是每个第 n 条新闻,而只是 first/second/...,那么也可以看看 altLayoutsOptionSplit:

OptionSplit for template parts (altLayoutsOptionSplit) allows you to directly access certain template parts in a template. Contrary to the good old “alternatingLayouts” feature the current template part is not determined by a simple counter but by an optionsplitted value. Blockquote

tt_news Documentation - changes in tt_news 3.0.0