Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap pagination #219

Closed
ste101 opened this issue Feb 26, 2024 · 0 comments
Closed

Bootstrap pagination #219

ste101 opened this issue Feb 26, 2024 · 0 comments

Comments

@ste101
Copy link
Contributor

ste101 commented Feb 26, 2024

Maybe this could help someone or it could be used as default PageBrowser.html template:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:kesearch="http://typo3.org/ns/Tpwd/KeSearch/ViewHelpers"
      data-namespace-typo3-fluid="true">
<f:comment><!--
	=====================
	Partials/PageBrowser.html
--></f:comment>

<f:if condition="{numberofresults} > {conf.resultsPerPage}">
    <div class="pages_total">
        <div class="result_txt">{f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:results')} {pagination.startRecordNumber}
            {f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:until')} {pagination.endRecordNumber}
            {f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:of')} {numberofresults}</div>
        <div class="kesearch_pagebrowser">
            <f:spaceless>
                <ul class="pagination">
                    <f:if condition="{pagination.paginator.numberOfPages} > {pagination.maximumNumberOfLinks}">
                        <li class="page-item{f:if(condition: '{pagination.previousPageNumber}', else: ' disabled')}">
                            <kesearch:link
                                piVars="{page: 1}"
                                keepPiVars="1"
                                class="page-link prev" title="{f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:pagebrowser_prev')}">&laquo;</kesearch:link>
                        </li>
                    </f:if>
                    <li class="page-item{f:if(condition: '{pagination.previousPageNumber}', else: ' disabled')}">
                        <kesearch:link
                            piVars="{page: pagination.previousPageNumber}"
                            keepPiVars="1"
                            class="page-link prev" title="{f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:pagebrowser_prev')}"><</kesearch:link>
                    </li>
                    <f:for each="{pagination.allPageNumbers}" as="page">
                        <f:if condition="{page} == {pagination.paginator.currentPageNumber}">
                            <f:then>
                                <li class="page-item active">
                                    <span class="page-link">{page}</span>
                                </li>
                            </f:then>
                            <f:else>
                                <li class="page-item">
                                    <kesearch:link
                                        piVars="{page: page}"
                                        keepPiVars="1"
                                        class="page-link">{page}</kesearch:link>
                                </li>
                            </f:else>
                        </f:if>
                    </f:for>
                    <li class="page-item{f:if(condition: '{pagination.nextPageNumber}', else: ' disabled')}">
                        <kesearch:link
                            piVars="{page: pagination.nextPageNumber}"
                            keepPiVars="1"
                            class="page-link next" title="{f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:pagebrowser_next')}">></kesearch:link>
                    </li>
                    <f:if condition="{pagination.paginator.numberOfPages} > {pagination.maximumNumberOfLinks}">
                        <li class="page-item{f:if(condition: '{pagination.nextPageNumber}', else: ' disabled')}">
                            <kesearch:link
                                piVars="{page: pagination.lastPageNumber}"
                                keepPiVars="1"
                                class="page-link next" title="{f:translate(key: 'LLL:EXT:ke_search/Resources/Private/Language/locallang_searchbox.xlf:pagebrowser_next')}">&raquo;</kesearch:link>
                        </li>
                    </f:if>
                </ul>
            </f:spaceless>
        </div>
    </div>
</f:if>

</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant