繁体   English   中英

TYPO3 tx_news,widget.paginate的位置有问题

[英]TYPO3 tx_news, issue with the position of widget.paginate

我在扩展名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>

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

将此添加到您的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>.......

嗨,我在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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM