简体   繁体   中英

TYPO3 tx_news, issue with the position of widget.paginate

I have a problem with the widget.paginate position in the extension tx_news, i'm working in TYPO3 v. 6.1 FLUID/EXTBASE.

My problem is that it's showing the widget.paginate by default, inside the Templates/News/list.html in my list show UL tag. and i want it to be outside the UL tags, I have tryed to move it around, but then it make some big changes to my layout, or do not work at all.

see bottom of page - enter link description here

How can I show the paginate links/widget outside the UL and after it ?

My Templates/News/list.html code

{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>

You can override the default Paginate Template and define your own Template

Add this to your TS template:

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

To know how the default template works, check out this Default Template for reference and modify your view accordingly.

If you trying to edit the default News List, change the default news path and write your FLUID template in that file:

plugin.tx_news.view.templateRootPath = YourNewTemplateNews.html

Close your tag before the widget. Of course, you'll have to make a few changes in your CSS to get what you want.

</ul>
          <f:else>
            <n:widget.paginate>.......

Hi i fix it in the Templates/News/list.html code

with this code.

{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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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