Split topnews from regular news in tx_news template with subheadline

96 views Asked by At

currently I'm trying to split up the topnews from regular news within a tx_news template. I need to insert a subheadline between topnews and the regular news.

So is there a chance to split the regular template?

<f:section name="content">
    <!--TYPO3SEARCH_end-->

    <f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">
        <div class="{category.title}"></div>
    </f:for>
    <f:if condition="{news}">
        <f:then>
            <div class="news-list-view">
                <f:if condition="{settings.hidePagination}">
                    <f:then>
                        <f:for each="{news}" as="newsItem" iteration="iterator">
                            <f:render partial="List/Item" arguments="{newsItem: newsItem,settings:settings,iterator:iterator}" />
                        </f:for>
                    </f:then>
                    <f:else>
                        <n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}" initial="{offset:settings.offset,limit:settings.limit}">
                            <f:for each="{paginatedNews}" as="newsItem" iteration="iterator">
                                <f:render partial="List/Item" arguments="{newsItem: newsItem,settings:settings,iterator:iterator}" />
                            </f:for>
                        </n:widget.paginate>
                    </f:else>
                </f:if>
            </div>
        </f:then>
        <f:else>
            <div class="no-news-found">
                <f:translate key="list_nonewsfound" />
            </div>
        </f:else>
    </f:if>
    <!--TYPO3SEARCH_begin-->
    <div class="showmorenews">
        <span><f:translate key="loadmore" /></span>
    </div>

</f:section>

thanks a lot

1

There are 1 answers

1
Georg Ringer On BEST ANSWER

The easiest thing would be to split that into 2 plugins, one to render only top news and one which only renders non-top news.

In the template, you can e.g check the {demand} property to know which plugin renders what or by using a custom layout.