0

我在扩展 tx_news 中的 widget.paginate 位置有问题,我正在使用 TYPO3 v. 6.1 FLUID/EXTBASE。

我的问题是它默认显示 widget.paginate,在我的列表中的 Templates/News/list.html 中显示 UL 标记。我希望它在 UL 标签之外,我试图移动它,但是它对我的布局进行了一些重大更改,或者根本不起作用。

见页面底部 -在此处输入链接描述

如何在 UL 之外和之后显示分页链接/小部件?

我的模板/新闻/list.html 代码

{namespace n=Tx_News_ViewHelpers}
<f:layout name="General" />
<!--
  =====================
    Templates/News/List.html
-->

<f:section name="content">
  <f:if condition="{news}">
    <f:then>
      <div class="news-list-view">
        <ul class="cbp_tmtimeline {newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">
        <f:if condition="{settings.hidePagination}">
          <f:then>
            <f:for each="{news}" as="newsItem">
              <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
            </f:for>
          </f:then>
          <f:else>
            <n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}">
              <f:for each="{paginatedNews}" as="newsItem">
                <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
              </f:for>
            </n:widget.paginate>
          </f:else>
        </f:if>
       </ul>
      </div>   
    </f:then>
    <f:else>
      <div class="no-news-found">
        <f:translate key="list_nonewsfound" />
      </div>
    </f:else>
  </f:if>
</f:section>
4

2 回答 2

1

您可以覆盖默认的分页模板并定义自己的模板

将此添加到您的 TS 模板中:

plugin.tx_news.settings.list.paginate.templatePath = YourNewTemplatePath.html

要了解默认模板的工作原理,请查看此默认模板以供参考并相应地修改您的视图。

如果您尝试编辑默认新闻列表,请更改默认新闻路径并将您的 FLUID 模板写入该文件:

plugin.tx_news.view.templateRootPath = YourNewTemplateNews.html

在小部件之前关闭您的标签。当然,您必须对 CSS 进行一些更改才能获得所需的内容。

</ul>
          <f:else>
            <n:widget.paginate>.......
于 2013-11-29T12:25:28.467 回答
0

嗨,我在 Templates/News/list.html 代码中修复了它

使用此代码。

{namespace n=Tx_News_ViewHelpers}
<f:layout name="General" />
<!--
  =====================
    Templates/News/List.html
-->

<f:section name="content">
  <f:if condition="{news}">
    <f:then>
        <f:if condition="{settings.hidePagination}">
          <f:then>
            <f:for each="{news}" as="newsItem">
              <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
            </f:for>
          </f:then>
          <f:else>  
            <n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}">       
            <div class="news-list-view">
            <ul class="cbp_tmtimeline {newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">            
              <f:for each="{paginatedNews}" as="newsItem">
                <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
              </f:for>         
            </ul>
           </div>
           </n:widget.paginate>
          </f:else>
        </f:if>
    </f:then>
    <f:else>
      <div class="no-news-found">
        <f:translate key="list_nonewsfound" />
      </div>
    </f:else>
  </f:if>
</f:section>
于 2013-11-29T13:15:12.383 回答