[TYPO3-news] [TYPO3-project-news] Re: MultiPageSingleView
Rolf Nakielski
rolf at nakielski.de
Thu Oct 29 16:56:11 CET 2015
OK - this is in fact an easy job using the view helper: n:paginateBodytext.
Works out of the box!
There is some sample template in the view helper class.
I added header links rel prev / next using the n:headerData view helper.
Good idea ist to add a realurl postVarSet:
'part' => array(
0 => array(
'GETvar' => 'tx_news_pi1[currentPage]',//tx_news
),
),
Big thank you to Georg Ringer. The extension offers even more functionality than documented.
Maybe our template helps. Use something like this instead of <f:format.html>{newsItem.bodytext}</f:format.html>.
It will display the part of the bodytext and some pagination, and will make the needed links in the page header.
<n:paginateBodytext object="{newsItem}"
as="bodytext" currentPage="{currentPage}">
<div class="articleBodyText">
<f:format.html>{bodytext}</f:format.html>
</div>
<f:if condition="{pagination.numberOfPages} > 1">
<div class="articlePagination">
<ul>
<f:if condition="{currentPage} > 1 ">
<li class="previous">
<f:link.action action="detail" arguments="{news: newsItem, currentPage: '{v:math.subtract(a: currentPage, fail: 0, b: 1)}'}">
<span class="glyphControl glyphPaginationPrevious"></span>
</f:link.action>
</li>
<n:headerData><link rel="prev" href="<f:uri.action action="detail" arguments="{news: newsItem, currentPage: '{v:math.subtract(a: currentPage, fail: 0, b: 1)}'}"/>" />
</n:headerData>
</f:if>
<f:for each="{pagination.pages}" as="page" iteration="iterator">
<f:if condition="{page.isCurrent}">
<f:then>
<li>
{f:if( then: '', else: '|', condition: '{iterator.isFirst}')}
<span class="current">Seite {page.number}</span>
</li>
</f:then>
<f:else>
<li>
{f:if( then: '', else: '|', condition: '{iterator.isFirst}')}
<f:if condition="{page.number} == 1">
<f:then>
<f:link.action action="detail" arguments="{news: newsItem}">
Seite {page.number}
</f:link.action>
</f:then>
<f:else>
<f:link.action action="detail" arguments="{news: newsItem, currentPage: page.number}">
Seite {page.number}
</f:link.action>
</f:else>
</f:if>
</li>
</f:else>
</f:if>
</f:for>
<f:if condition="{currentPage} < {pagination.numberOfPages}">
<li class="next">
<f:link.action action="detail" arguments="{news: newsItem, currentPage: '{v:math.sum(a: currentPage, fail: 0, b: 1)}'}">
<span class="glyphControl glyphPaginationNext"></span>
</f:link.action>
</li>
<n:headerData><link rel="next" href="<f:uri.action action="detail" arguments="{news: newsItem, currentPage: '{v:math.sum(a: currentPage, fail: 0, b: 1)}'}"/>" />
</n:headerData>
</f:if>
</ul>
</div>
</f:if>
</n:paginateBodytext>
More information about the TYPO3-project-news
mailing list