Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pagination 键入3 tx_新闻,发布widget.paginate的位置_Pagination_Typo3_Typo3 6.1.x - Fatal编程技术网

Pagination 键入3 tx_新闻,发布widget.paginate的位置

Pagination 键入3 tx_新闻,发布widget.paginate的位置,pagination,typo3,typo3-6.1.x,Pagination,Typo3,Typo3 6.1.x,我在tx_新闻分机中的widget.paginate位置有问题,我在TYPO3 v中工作。6.1流体/外部基础 我的问题是,它在默认情况下显示widget.paginate,在我的list show UL标记的Templates/News/list.html中。我希望它在UL标签之外,我试着移动它,但是它对我的布局做了一些大的改变,或者根本不起作用 见第页底部- 如何在UL外部和之后显示分页链接/小部件 我的模板/News/list.html代码 {namespace n=Tx_News_Vie

我在tx_新闻分机中的widget.paginate位置有问题,我在TYPO3 v中工作。6.1流体/外部基础

我的问题是,它在默认情况下显示widget.paginate,在我的list show UL标记的Templates/News/list.html中。我希望它在UL标签之外,我试着移动它,但是它对我的布局做了一些大的改变,或者根本不起作用

见第页底部-

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

我的模板/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>
      <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>
{namespace n=Tx\u News\u viewers}

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

将此添加到TS模板:

plugin.tx\u news.settings.list.paginate.templatePath=YourNewTemplatePath.html

若要了解默认模板的工作方式,请查看此文件以供参考,并相应地修改视图

如果试图编辑默认新闻列表,请更改默认新闻路径并将流体模板写入该文件:

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>
      <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>
用这个代码

{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>
{namespace n=Tx\u News\u viewers}

Hi RaD0,分页的默认模板,工作正常,只是放置它,这就是问题所在。因此,我想在我的页面上放置/调用另一个位置的是n:widget.paginate。如果您不知道新闻列表的默认模板,那么编写自己的模板是一个好主意,而不是更改默认扩展名附带的模板。我编辑了我的答案。