首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在带有副标题的tx_news模板中拆分热门新闻和常规新闻

问在带有副标题的tx_news模板中拆分热门新闻和常规新闻
EN

Stack Overflow用户
提问于 2017-08-28 17:24:53
回答 1查看 61关注 0票数 0

目前,我正在尝试在tx_news模板中将热门新闻从常规新闻中分离出来。我需要在topnews和常规新闻之间插入一个副标题。

那么有没有可能拆分常规模板呢?

代码语言:javascript
复制
<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>

非常感谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-28 17:45:33

最简单的办法就是把它分成两个插件,一个只呈现热门新闻,另一个只呈现非热门新闻。

例如,在模板中,您可以检查{demand}属性,以了解哪个插件呈现了什么内容,或者使用自定义布局。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45915765

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档