質問

I use Typo3 6.1. And the Newsextension news (tx_news). It's work fine - but I have a problem.

I want to wrap a NewsItem with a "Header" and a "Footer", but I don't find a solution.

Here is my Fluid Template:

    <f:section name="content">
       <f:if condition="{news}">
          <f:then>
              <f:for each="{news}" as="newsItem" iteration="iterator">
                 <f:if condition="{iterator.isFirst}">
                    <f:render partial="List/ItemNewsHeader" arguments="{newsItem: newsItem, settings:settings}" />
                </f:if>
                <f:if condition="{newsItem.istopnews = FALSE}">
                   <f:then>
                      <f:render partial="List/ItemNews" arguments="{newsItem: newsItem, settings:settings}" />
                   </f:then>
               </f:if>
               <f:if condition="{iterator.isLast}">
                  <f:render partial="List/ItemNewsFooter" arguments="{newsItem: newsItem, settings:settings}" />
               </f:if>
           </f:for>
        </f:then>
   </f:if>
</f:section>

I try here to wrap all NewsItems with the ItemNewsHeader and the ItemNewsHeader, but it will be print out by every NewsItem and I don't know why.

役に立ちましたか?

解決

Ok - i have it. It's easy. Here my new example for "newsItems". All Items will be wrap with the specific partial. On this example - all "normal news", without topnews.

<f:if condition="{newsItem.istopnews}">
    <f:then>

    </f:then>
    <f:else>
        <f:if condition="{iterator.isFirst}">
            <f:render partial="List/ItemPressHeader" arguments="{newsItem: newsItem, settings:settings}" />
        </f:if>
        <f:render partial="List/ItemPress" arguments="{newsItem: newsItem, settings:settings}" />

        <f:if condition="{iterator.isLast}">
            <f:render partial="List/ItemPressFooter" arguments="{newsItem: newsItem, settings:settings}" />
        </f:if>
    </f:else>
</f:if>

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top